centos6-7 yum安装php的方法(推荐)
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.添加rpm源
先添加下阿里云的epel源
CentOS6.X: rpm-Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm CentOS7.X: rpm-Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpm
如果想删除上面安装的包,重新安装
rpm-qa|grepwebstatic rpm-e上面搜索到的包即可
3.运行yuminstall安装php
php5.5:
yuminstallphp55w.x86_64php55w-cli.x86_64php55w-common.x86_64php55w-gd.x86_64php55w-ldap.x86_64php55w-mbstring.x86_64php55w-mcrypt.x86_64php55w-mysql.x86_64php55w-pdo.x86_64php55w-fpmphp55w-devel
php5.6:
yuminstallphp56w.x86_64php56w-cli.x86_64php56w-common.x86_64php56w-gd.x86_64php56w-ldap.x86_64php56w-mbstring.x86_64php56w-mcrypt.x86_64php56w-mysql.x86_64php56w-pdo.x86_64php56w-fpmphp56w-devel
php7.0:
yuminstallphp70w.x86_64php70w-cli.x86_64php70w-common.x86_64php70w-gd.x86_64php70w-ldap.x86_64php70w-mbstring.x86_64php70w-mcrypt.x86_64php70w-mysql.x86_64php70w-pdo.x86_64php70w-fpmphp70w-devel
总结
以上所述是小编给大家介绍的centos6-7yum安装php的方法,希望对大家有所帮助!
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。