由于目前官方提供的最高版是PHP5.1.6的rpm包,这个版本缺少一些函数,如json_decode等,oracle提供了x86_64下的rpm包,需要的可以这儿下载:
http://oss.oracle.com/projects/php/files/EL5/x86_64/
目标机是32位的redhat5.2 所以只好自已编译安装,以下是安装过程:
tar jxvf php-5.3.3.tar.bz2
cd php-5.3.3
./configure --prefix=/usr/local/php /
--with-apxs2=/usr/local/apache/bin/apxs /
--with-zlib /
--with-png-dir /
--with-xmlrpc /
--with-iconv /
--enable-soap /
--enable-inline-optimization /
--enable-sockets /
--enable-mbstring /
--enable-static /
--with-openssl=/usr/local/ssl /
--with-curl=/usr/local/curl
(需要其它模块的自已加)
make
make
报错:
undefined reference to `libiconv_open'
解决办法:
Makefile 中加入 -liconv
make install
cp php.ini-development /usr/local/php/lib/php.ini
http.conf中加入:
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
/etc/init.d/httpd restart 报错: undefined symbol: zend_parse_parameters 解决办法: bison-2.3-2.1.i386.rpm bison-devel-2.3-2.1.i386.rpm bison-runtime-2.3-2.1.i386.rpm 安装以上包,光盘里面就有 make clean make distclean make make install /etc/init.d/httpd restart