查看php版本
php -v
检查当前安装的php包
yum list installed | grep php
解决“Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast”问题,没有遇到可以跳过;
yum clean all
删除安装的PHP包
yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mysql.x86_64 php-odbc.x86_64 php-pdo.x86_64 php-process.x86_64 php-xml.x86_64 php-xmlrpc.x86_64
升级包
Centos 5.X
CentOs 6.x
CentOs 7.X
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
另外,如果想删除上面安装的包,重新安装,可以先查询
rpm -qa | grep webtatic
然后删除
rpm -e “输入上面搜索到的包即可”
安装php 5.6
// 5.5 执行下面
yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64
// 5.6 执行下面
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
安装PHP FPM
yum install php55w-fpm
yum install php56w-fpm
yum install php70w-fpm
网友评论