Linux下多版本PHP共存需要自己手工编译安装。下载PHP源文件到/opt/src目录(自己定义的目录)
php 5.4 安装路径 $ wget http://cn2.php.net/get/php-5.4.29.tar.bz2/from/this/mirror -O php-5.4.29.tar.bz2
2. cd /www/wdlinux/phps
3. tar -xvjf php-5.4.29.tar.bz2
4.cd php-5.4.29
5.编译执行
./configure --prefix=/usr/local/php54 --with-libxml-dir=/usr --with-config-file-path=/usr/local/php54/etc/ --with-mysql --with-mysqli --with-gd --enable-gd-native-ttf --with-zlib --with-mcrypt --with-pdo-mysql --enable-shmop --enable-soap --enable-sockets --enable-wddx --enable-zip --with-xmlrpc --enable-fpm --enable-mbstring --with-zlib-dir --with-bz2 --with-curl --enable-exif --enable-ftp --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv --enable-xml --enable-bcmath --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --with-openssl --enable-pcntl --with-gettext --enable-session
报utf8错误 需要去掉 --with-imap --with-imap-ssl
make: *** [sapi/cli/php] Error 1
make ZEND_EXTRA_LIBS='-liconv'
6.make
7.sudo make install
8.cp php.ini-development /ww/wdlinux.phps/5429/lib/php.ini
9.修改php-fpm 监听端口 和