CentOS7编译安装PHP7.1

1、安装编译依赖包

yum install epel-release -y
yum install libicu-devel 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 -y

2、配置编译参数

./configure --prefix=/usr/local/php71 \
--with-config-file-path=/usr/local/php71/etc \
--with-config-file-scan-dir=/usr/local/php71/etc/conf.d \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-pear \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-zlib \
--with-iconv-dir \
--with-mhash \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-openssl \
--with-xsl \
--with-recode \
--with-libxml-dir \
--with-xmlrpc \
--with-gettext \
--enable-mysqlnd \
--enable-mysqlnd-compression-support \
--enable-sockets \
--enable-soap \
--enable-mbstring \
--enable-gd-jis-conv \
--enable-zip \
--enable-xml \
--enable-bcmath \
--enable-calendar \
--enable-shmop \
--enable-dba \
--enable-wddx \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-opcache \
--enable-pcntl \
--enable-maintainer-zts 

3、编译安装

make -j4 && make -j4 install

4、复制配置文件及脚本

cp -r php.ini-production /usr/local/php71/etc/php.ini
cp -r sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm71
cp -r sapi/fpm/php-fpm.conf /usr/local/php71/etc/php-fpm.conf
cp -r sapi/fpm/www.conf /usr/local/php71/etc/php-fpm.d/

5、启动服务

chmod +x /etc/init.d/php-fpm71
/etc/init.d/php-fpm71 start
讨论数量: 0

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!