检查当前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版本,以确认安装是否成功