yum -y install bzip2 bzip2-devel libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel free Type -devel libmcrypt-devel mhash gd gd-devel
1. 下载包
wget http://mirrors.sohu.com/php/php-5.6.2.tar.gz
2. 解压
tar -zxvf php-5.6.2.tar.gz cd php-5.6.2
3. 编译安装
依赖的话提示缺啥就安装
'./configure' '--prefix=/usr/local/php5.4.9' '--enable-fpm' '--enable-inline-optimization' '--disable-debug' '--disable-rpath' '--enable-shared' '--enable-soap' '--with-xmlrpc' '--with-openssl' '--with-mcrypt' '--with-pcre-regex' '--with-sqlite3' '--with-zlib' '--enable-bcmath' '--with-iconv' '--with-bz2' '--enable-calendar' '--with-curl' '--with-cdb' '--enable-dom' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--with-pcre-dir' '--enable-ftp' '--with-gd' '--with-openssl-dir' '--with-jpeg-dir' '--with-png-dir' '--with-freetype-dir' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-gettext' '--with-gmp' '--with-mhash' '--enable-json' '--enable-mbstring' '--enable-mbregex' '--enable-mbregex-backtrack' '--with-libmbfl' '--with-onig' '--with-mysql=mysqlnd' '--enable-pdo' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-zlib-dir' '--with-pdo-sqlite' '--with-readline' '--enable-session' '--enable-shmop' '--enable-simplexml' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-libxml-dir' '--with-xsl' '--enable-zip' '--enable-mysqlnd-compression-support' '--with-pear'
make && make install