background image

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 安装包:

代码如下

:

# 解压缩安装包

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 \