Centos下Yum安装PHP5.5,5.6,7.0

前端之家收集整理的这篇文章主要介绍了Centos下Yum安装PHP5.5,5.6,7.0前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案:

1.检查当前安装的PHP

yumlistinstalled|grepPHP

如果有安装的PHP包,先删除他们

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-fpm
yum install PHP56w-fpm
yum install PHP70w-fpm


systemctl start PHP-fpm
原文链接:https://www.f2er.com/centos/379129.html

猜你在找的CentOS相关文章