1. 程式人生 > >Linux平滑編譯升級php5.5至5.6

Linux平滑編譯升級php5.5至5.6

今天想寫自動化測試專案時,安裝phpunit 時提示 需要安裝php5.6 版本以上。

伺服器型別 CentOS 6.5

目前php5.5 要升級到php5.6 

首先 連上伺服器  先把 PHP-fpm服務關閉(其實不影響的,因為程式在記憶體裡面跑 不關也沒事的) 然後 先把 /apps/svr/php 重新命名 以防止如果新版本更新失敗 回滾

 mv /apps/svr/php   /apps/svr/php5.5

讓後再/usr/local/src/下

wget  http://www.php.net/distributions/php-5.6.27.tar.gz

tar -zxvf  php-5.6.27.tar.gz

因為是升級 所以 php很多依賴包我都已經裝過了  先貼上我的 configure 配置引數

./configure --prefix=/apps/svr/php --with-config-file-path=/apps/svr/php/etc --with-mysql=/apps/svr/mysql --with-mysqli=/apps/svr/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/apps/svr/mysql --with-gd --with-png-dir=/apps/lib/libpng --with-jpeg-dir=/apps/lib/jpeg --with-freetype-dir=/apps/lib/freetype --with-xpm-dir=/usr/  --with-zlib-dir=/apps/lib/zlib --with-t1lib=/apps/lib/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype 


make 

make install  接下來的步驟跟安裝php5.5 一樣。

memcache 版本不支援

找到對應的版本


找到linux 版本下載安裝

tar -zxvf memcache-3.0.8.tgz

cd memcache-3.0.8

/apps/svr/php/bin/phpize

./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir

make

make install

成功

redis 也找到對應的版本下載安裝即可