獲取資源:
cd /usr/local/src/
wget http://cn2.php.net/distributions/php-5.4.45.tar.bz2
tar jxvf php-5.4.45.tar.bz2
環境配置:
rpm -ivh 'http://www.lishiming.net/data/attachment/forum/epel-release-6-8_64.noarch.rpm'
yum install -y libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libjpeg libjpeg-devel libpng libpng-devel freetype-devel libmcrypt-devel
編譯、安裝:
cd php-5.4.45
./buildconf --force
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif --disable-ipv6
make
make install
echo $?
0
安裝成功!
注:在編譯過程中可能會出現很多錯,大多數是因為缺少包的原因,卻啥包裝啥,上面環境配置中,基本上包含了本次安裝所有需要的包
http://www.bkjia.com/Linuxjc/1193229.html TechArticle