Centos7.2 编译安装PHP7,centos7.2编译php7
步骤如下:
1、安装依赖
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
2、下载PHP源码包
wget http://cn2.php.net/distributions/php-7.0.27.tar.gz
3、配置参数
./configure --prefix=/alidata/server/php-7.0.27\--with-apxs2=/alidata/server/httpd-2.4.10/bin/apxs \--with-curl \--with-freetype-dir\--with-gd \--with-gettext \--with-iconv-dir\--with-kerberos \--with-libdir=lib64 \--with-libxml-dir\--with-mysqli \--with-openssl \--with-pcre-regex \--with-pdo-mysql \--with-pdo-sqlite \--with-pear \--with-png-dir\--with-xmlrpc \--with-xsl \--with-zlib \--enable-fpm \--enable-bcmath \--enable-libxml \--enable-inline-optimization \--enable-gd-native-ttf \--enable-mbregex \--enable-mbstring \--enable-opcache \--enable-pcntl \--enable-shmop \--enable-soap \--enable-sockets \--enable-sysvsem \--enable-xml \--enable-zip
4、编译
make
注意:我这里报错提示“undefined reference to `libiconv_open'”,make 时增加 ZEND_EXTRA_LIBS=’-liconv’ 参数即可,如下
make ZEND_EXTRA_LIBS='-liconv'
5、安装
make install
6、完成安装后需处理
6.1、将 alidata/server/php 软链接设置为 alidata/server/php-7.0.27
cd /alidata/www/serverrm -rf phpln -s /alidata/server/php-7.0.27 php
6.2、 httpd.conf文件里开启PHP7模块
#LoadModule php5_module modules/libphp5.so
LoadModule php7_module modules/libphp7.so
6.4、 重新Apache
systemctl stop httpd
systemctl start httpd
http://www.dengb.com/Linuxjc/1296821.htmlwww.dengb.comtruehttp://www.dengb.com/Linuxjc/1296821.htmlTechArticleCentos7.2 编译安装PHP7,centos7.2编译php7 步骤如下: 1、安装依赖 yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2 -devel libcurl libcurl-devel l...