1. Clean up the old version of php on the system
# You can use the following methods
rpm -qa|grep php*yum list installed | grep php
# Generally, the following software needs to be cleaned
yum remove php php-devel php-cli php-common php-gd php-ldap php-mbstring php-mcrypt php-mysql php-pdo php55w-fpm
# Note: You are using yum uninstall software. Before uninstalling, please check to make sure that the software you are using will not be deleted to prevent errors.
2.Updatephp 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 For CentOS7.x
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3.InstallationRequired php version
Installation related to php5.5 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
# After the installation is complete, you can use the following command to check
php -v
The above is the detailed content of How to install php5.5, php5.6 and php7.0 instances with yum. For more information, please follow other related articles on the PHP Chinese website!