Install php5.5, php5.6, php7.0, and php5.5php5.6 in yum.
This document describes how to install and use multiple php versions in CentOS.
1. Clear the old version of php on the System
# Use the following methods
rpm -qa|grep php*yum list installed | grep php
# The following software must be cleaned up:
yum remove php php-devel php-cli php-common php-gd php-ldap php-mbstring php-mcrypt php-mysql php-pdo php55w-fpm
# Note: yum is used to uninstall the software. Before uninstalling the software, check whether the software in use is not deleted to prevent errors.
2. Update the php related yum source on the system.
# Applicable to CentOS5.x
rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
# Applicable to CentOS6.x
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
# Applicable to CentOS7.x
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3. Install the required php version
# Install php5.5 related software
yum install php55w php55w-devel php55w-cli php55w-common php55w-gd php55w-ldap php55w-mbstring php55w-mcrypt php55w-pdo php55w-mysql php55w-fpm
# Install php5.6 related software
yum install php56w php56w-devel php56w-cli php56w-common php56w-gd php56w-ldap php56w-mbstring php56w-mcrypt php56w-pdo php56w-mysql php56w-fpm
# Install php7.0 related software
yum install php70w php70w-devel php70w-cli php70w-common php70w-gd php70w-ldap php70w-mbstring php70w-mcrypt php70w-pdo php70w-mysql php70w-fpm
# Run the following command to check the installation:
php -v
Complete.