我的是centos 7.1系统

卸载重装方式:(安全)

CentOS/RHEL 7.x:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS/RHEL 6.x:
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Now you can install PHP 5.6 (along with an opcode cache) by doing:

yum install php56w php56w-opcache

直接升级:(有风险)
yum install yum-plugin-replace
yum replace php-common –replace-with=php56w-common
yum install php56w-opcache