1、查看已经安装的PHP组件
yum list installed| grep php
php.x86_64 5.4.16-48.el7 @base
php-cli.x86_64 5.4.16-48.el7 @base
php-common.x86_64 5.4.16-48.el7 @base
php-devel.x86_64 5.4.16-48.el7 @base
php-gd.x86_64 5.4.16-48.el7 @base
php-mbstring.x86_64 5.4.16-48.el7 @base
php-mysql.x86_64 5.4.16-48.el7 @base
php-pdo.x86_64 5.4.16-48.el7 @base
php-pear.noarch 1:1.9.4-22.el7 @base
php-pecl-apcu.x86_64 4.0.11-1.el7 @epel
php-process.x86_64 5.4.16-48.el7 @base
php-xml.x86_64 5.4.16-48.el7 @base
2、删除php 5.4的相关依赖:
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-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
3、安装配置新的源
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
rpm -Uvh epel-release-latest-7.noarch.rpm webtatic-release.rpm
4、安装php到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