7.1
安装依赖
前面nginx的依赖中已经有了openssl,但php也需要,所以跟前面有重复,7.2同理。
yum -y install libmcrypt libmcrypt-devel libxml2 libxml2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype-devel openssl openssl-devel
解压缩
tar zxf php-7.1.24.tar.gz -C /usr/local/src/
cd /usr/local/src/php-7.1.24/
配置、编译、安装
这里模拟一个服务器安装两个php,所以路径上使用php71、php72
./configure \
--prefix=/usr/local/php71 \
--with-config-file-path=/usr/local/php71/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--without-pear \
--with-gettext \
--enable-fileinfo \
--enable-maintainer-zts