系统环境:Centos7.6
PHP版本:php-7.4.16
Nginx版本:nginx1.6
一、安装PHP
1. 下载安装编译工具
yum groupinstall 'Development Tools'
2.安装依赖包
yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel oniguruma oniguruma-devel sqlite-devel -y
3.下载并解压php7.4
wget https://www.php.net/distributions/php-7.4.16.tar.gz
tar -zxvf php-7.4.16.tar.gz
cd php-7.4.16
4.编译安装(./configure --help 查看编译参数)