Linux编译升级php的详细方法
前端之家收集整理的这篇文章主要介绍了
Linux编译升级php的详细方法,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
服务器环境:CentOS – 5.4
PHP升级:5.4.14 - 5.5.0
升级心得:比较顺利,但是有一点需要说明:eaccelerator无法兼容PHP5.5.0,好在PHP在5.5.0默认提供了Zend OPcache,所以一直习惯eaccelerator的朋友如果要升级到PHP5.5.0的话,可能要暂时和eaccelerator说bye bye了。
1、安装PHP5.5.0
下载
PHP安装包:
http://www.
PHP.net/get/
PHP-5.5.0.tar.gz/from/a/mirror
<div class="codetitle">
<a style="CURSOR: pointer" data="54305" class="copybut" id="copybut54305" onclick="doCopy('code54305')"> 代码如下: <div class="codebody" id="code54305">
# 解压缩安装包
tar zxvf
PHP-5.5.0.tar.gz# 进入目录
cd
PHP-5.5.0# 编译安装
./configure \
--prefix=/usr/local/webserver/
PHP-d/
PHP-5.5.0 \
--with-config-file-path=/usr/local/webserver/
PHP-d/
PHP-5.5.0/etc \
--with-config-file-scan-dir=/usr/local/webserver/
PHP-d/
PHP-5.5.0/etc/
PHP.d \
--with-curl=/usr/local/lib \
--with-freetype-dir=/usr/lib64 \
--with-gd \
--with-gettext \
--with-iconv-dir=/usr/local/lib \
--with-jpeg-dir=/usr/lib64 \
--with-kerberos \
--with-ldap \
--with-ldap-sasl \
--with-libdir=lib64 \
--with-libxml-dir=/usr/lib64 \
--with-mcrypt \
--with-mhash \
--with-
MysqL \
--with-
MysqLi \
--with-openssl \
--with-pcre-regex=/usr \
--with-pdo-
MysqL=shared \
--with-pdo-
sqlite=shared \
--with-pear=/usr/local/lib/
PHP \
--with-png-dir=/usr/lib64 \
--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 \
--disable-rpathmake ZEND_EXTRA_LIBS='liconv'
make install
cp
PHP.ini-production /usr/local/webserver/
PHP-d/
PHP-5.5.0/etc/
PHP.ini
同样去处的还有:'–enable-discard-path','–enable-fastcgi','–enable-force-cgi-redirect','–with-curlwrappers'
.