检查当前PHP的安装包
# yum list installed | grep php
移除当前PHP的安装包,否则容易起冲突
# yum remove php*
因为是CentOS 6.5,所以用以下URL
# rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
如果是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
查看YUM源上能用PHP安装
# yum list php*
安装PHP5.5及需要的扩展
# yum install php55w php55w-devel php55w-common php55w-mysql php55w-pdo php55w-opacache php55w-xml
再次查看PHP版本,以确认安装是否成功
本文出自 “11354577” 博客,请务必保留此出处http://11364577.blog.51cto.com/11354577/1912108
原文地址:http://11364577.blog.51cto.com/11354577/1912108