http://www.linux-centos.com/2014/11/16/%E7%BC%96%E8%AF%91%E5%8D%87%E7%BA%A7%E4%BB%8Ephp5-2-17%E5%88%B0php5-4-35/
1. 备份/usr/local/php
1
|
tar zcvf /bak/php5.2.17.tar.gz /usr/local/php
|
2. 备份/etc/php.ini
1
|
cp /etc/php.ini /etc/php.5.2.17.ini.bak
|
3. 备份
1
|
cp /usr/local/apache/modules/libphp5.so libphp5.so.bak
|
4. 开始编译升级PHP5.4.35
先删除/usr/local/php
1
|
rm -rf /usr/local/php
|
安装依赖库
1
|
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel gd* bzip2 bzip2-devel ncurses ncurses-devel net-snmp-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libmcrypt libmcrypt-devel
|
建立一个软链接
1
2
3
4
5
|
## 64位
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64
## 32位
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib
|
下载、编译、安装PHP5.4.35
1
2
3
4
5
6
7
8
9
10
11
|
cd /usr/local/src
wget http://cn2.php.net/get/php-5.4.35.tar.gz/from/this/mirror
tar zxvf php-5.4.35.tar.gz
cd php-5.4.35
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --with-freetype-dir --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --enable-session --with |