Centos 6.4 32bit 下编译安装 php 5.5.5 的笔记,php 5.5.x 和 centos 源里面的 php 5.3.x 之间的性能差异见升级到 PHP 5.5.x + opcache。
首先是编译准备工作:
1
|
.yum groupinstall "Development tools" |
然后是编译安装 PHP 5.5.x 需要用到的 devel 包:
1.
|
yum install libxml2-devel gd-devel libmcrypt-devel libcurl-devel openssl-devel |
从官方下载,解压:
1
2
3.
|
.wget http: //us3 .php.net /get/php-5 .5.5. tar .gz /from/cn2 .php.net /mirror .tar -xvf php-5.5.5. tar .gz cd php-5.5.5 |
编译安装 php 5.5 的参数:
1
|
. /configure --prefix= /usr/local/php --with-config- file -path= /usr/local/php/etc --with-apxs2= /usr/local/apache2/bin/apxs --disable-cli
-- enable -shared --with-libxml- dir --with-gd --with-openssl -- enable -mbstring --with-mcrypt --with-mysqli --with-mysql -- enable -opcache
-- enable -mysqlnd -- enable -zip --with-zlib- dir --with-pdo-mysql --with-jpeg- dir --with-freetype- dir --with-curl
--without-pdo-sqlite --without-sqlite3 --with-iconv= /usr/local/ |
|
make ZEND_EXTRA_LIBS=’-liconv’ make install cp php.ini-production /etc/php .ini |
修改httpd-conf.conf文件
1
2
|
AddType application /x-httpd-php .php AddType application /x-httpd-php-source .phps |