原文:https://segmentfault.com/a/1190000018985343
PHP
依赖
yum install libxml2-devel bzip2-devel libcurl-devel libpng-devel libXpm-devel libjpeg-turbo-devel gmp-devel freetype-devel libvpx-devel krb5-devel zlib-devel pcre-devel pam-devel openssl openssl-devel libmcrypt libmcrypt-devel
libmcrypt libmcrypt-devel 可能不存在
需要添加repo
yum install epel-release
yum install libmcrypt libmcrypt-devel
安装步骤参考
- 下载包 wget http://php.net/get/php-7.2.5.tar.gz/from/this/mirror
- 拓展差异
PHP7.2 enable-gd-native-ttf with-mcrypt 已经不支持
- 编译参数 酌情加减(可移步其他文章了解参数 PHP编译参数详解)
./configure --prefix=/opt/php72 --with-config-file-scan-dir=/opt/php72/etc/php.d --disable-debug --with-pic --with-bz2 --with-gettext --with-gmp --enable-mbregex --enable-mbstring --with-openssl --with-zlib --with-layout=GNU --enable-exif --enable-zip --enable-sockets --enable-xml --with-pear --enable-fpm --with-pdo-mysql --with-curl --with-gd --with-mysqli --enable-soap --with-fpm-user=www --with-fpm-group=www --with-freetype-dir --enable-mbstring --enable-bcmath --with-jpeg-dir --with-ldap-dir
配置文件整理
cp php-fpm.conf.default php-fpm.conf
cp www.conf.default www.conf
cp php.ini-production /opt/php7/etc/php.ini 从源码包复制php.ini配置