centos6.6上 nginx+php5.3将php版本升级php5.6
1、到php官网下载php-5.6.28.tar.gz,用ftp或者ssh工具将下载好的安装包上传到Linux服务器上。
2、卸载php5.3版本,linux上只要将对应php安装目录删除即可。rm /usr/local/php -fr (为什是/usr/local/php这个目录,这由php的安装目录而定)
3、解压php-5.6.28.tar.gz。解压命令:tar -zxvf php-5.6.28.tar.gz解压完之后,会生成php-5.6.28目录
4、进入解压后的目录。cd php-5.6.28进入目录后,执行./configure --prefix=/usr/local/php #指定php安装的目录--with-mysql=mysqlnd--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd--with-freetype-dir=/usr/local/freetype #指定freetype的路径,由freetype安装的真实路径定--with-gd=/usr/local/gd #指定gd的路径,由gd安装的真实路径定--with-zlib--with-libxml-dir=/usr/local/libxml2#指定libxml2的路径,由libxml2安装的真实路径定--with-jpeg-dir=/usr/local/jpeg#指定jpeg的路径,由jpeg安装的真实路径定--with-png-dir=/usr/local/png#指定png的路径,由png安装的真实路径定--enable-mbstring=all--enable-mbregex--enable-shared--with-openssl-dir=/usr/local/openssl#指定openssl的路径,由openssl安装的真实路径定--with-openssl--enable-fpm--with-config-file-path=/usr/local/php/etc #指定php的配置文件路径--with-curlwrappers
5、编译安装。make && make install
6、查看安装php版本是否升级成功。php -v