默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案:
1.检查当前安装的PHP包
yumlistinstalled|grepPHP
yumremovePHP.x86_64PHP-cli.x86_64PHP-common.x86_64PHP-gd.x86_64PHP-ldap.x86_64PHP-mbstring.x86_64PHP-mcrypt.x86_64PHP-MysqL.x86_64PHP-pdo.x86_64
2.Centos
rpm-Uvhhttp://mirror.webtatic.com/yum/el5/latest.rpm ##CentOs 5.x
rpm-Uvhhttp:mirror.webtatic.com/yum/el6/latest.rpm ##CentOs6.x
rpm-Uvhhttps:mirror.webtatic.com/yum/el7/epel-release.rpm ##CentOs7.X
rpm-Uvhhttps:mirror.webtatic.com/yum/el7/webtatic-release.rpm
如果想删除上面安装的包,重新安装
rpm -qa | grep webstatic
rpm -e 上面搜索到的包即可
3.运行yum install
yuminstallPHP55w.x86_64PHP55w-clicommongdldapmbstringmcrypt-MysqLpdox86_64
yum install PHP56w.x86_64 PHP56w-cli.x86_64 PHP56w-common.x86_64 PHP56w-gd.x86_64 PHP56w-ldap.x86_64 PHP56w-mbstring.x86_64 PHP56w-mcrypt.x86_64 PHP56w-MysqL.x86_64 PHP56w-pdo.x86_64
注:如果想升级到5.6把上面的55w换成56w就可以了。
yum install PHP70w.x86_64 PHP70w-cli.x86_64 PHP70w-common.x86_64 PHP70w-gd.x86_64 PHP70w-ldap.x86_64 PHP70w-mbstring.x86_64 PHP70w-mcrypt.x86_64 PHP70w-MysqL.x86_64 PHP70w-pdo.x86_64
4.安装PHP FPM
yum install PHP55w-fpmyum install PHP56w-fpmyum install PHP70w-fpm
原文链接:https://www.f2er.com/centos/377076.html