今天想写自动化测试项目时,安装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 也找到对应的版本下载安装即可