centos php5.4 升级支持zabbix5
官网下载源码包
https://www.php.net/downloads.php
安装依赖包,编译安装后改配置文件启用php连接数据库功能
yum -y install gcc pcre-devel openssl-devel zlib-devel
yum -y install mysql-devel net-snmp-devel curl-devel libvirt libevent-devel libxml2-devel libtool sqlite-devel libpng-devel gd-devel
yum -y install https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-6.8.2-1.el7.x86_64.rpm https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-6.8.2-1.el7.x86_64.rpm
tar xf php-7.4.12.tar.gz
./configure --prefix=/usr --enable-fpm --enable-shared --enable-bcmath --enable-json --enable-mbstring --enable-mysqlnd-compression-support --enable-xmlreader --enable-xmlwriter --enable-cli --enable-gd --enable-xml --disable-phpdbg --disable-phpdbg-webhelper --disable-rpath --with-xmlrpc --with-openssl --with-sqlite3 --with-zlib --with-iconv --with-bz2 --with-curl --with-cdb --with-openssl-dir --with-mhash --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-zlib-dir --with-pdo-sqlite --with-gettext
./configure --prefix=/usr --with-curl --with-freetype --enable-gd --with-jpeg --with-gettext --with-gmp --with-mysqli --with-openssl --with-pdo-mysql --with-pear --with-xmlrpc --with-xsl --with-mhash --enable-fpm --enable-bcmath --enable-mbstring --enable-sockets --enable-xml --enable-embed --enable-phpdbg --with-ldap --with-snmp --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --enable-pcntl --with-zlib --with-readline --enable-shmop --enable-sockets
make & make install
cp php.ini-development /usr/lib/php.ini
vim /usr/lib/php.ini #修改932,1166行
mysqli.default_socket = /var/lib/mysql/mysql.sock
php-fpm #启动服务
查看php版本信息
查看已安装模块