原文:https://www.cnblogs.com/lostk/p/6225055.html
1. wget http://hk1.php.net/get/php-7.2.3.tar.gz/from/this/mirror
2. tar -xzvf php-7.2.3.tar.gz
3. cd php-7.2.3.tar.gz
./configure --prefix=/usr/local/php71 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu/ --enable-ftp --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm --with-iconv --with-xpm-dir=/usr
安装各种依赖库
出现报错 Cannot find OpenSSL's <evp.h>
则执行 yum install openssl openssl-devel
出现报错 Please reinstall the libcurl distribution
则执行 yum -y install curl-devel
出现报错 jpeglib.h not found
则执行 yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y
和执行yum install libjpeg-devel
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
这是bzip2软件包没有安装
解决办法
yum install bzip2-devel.x86_64 -y
configure: error: xpm.h not found.
yum install libXpm-devel
error: Unable to locate gmp.h
Fix: yum install gmp-devel
现象:Unable to detect ICU prefix or /usr//bin/icu-config failed. Please verify ICU install
prefix and make sure icu-config works
解决办法:yum install -y icu libicu libicu-devel
错误:mcrypt.h not found. Please reinstall libmcrypt.
解决办法:yum install php-mcrypt libmcrypt libmcrypt-devel
错误: configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
解决办法:yum install postgresql-devel
错误 : configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解决: yum install libxslt-devel