Since the CentOS default yum source PHP version is too low, manual compilation and installation is a bit of a problem, then how to install the latest version of the Yum installation. So, today we're going to learn how to install the latest version of PHP with Yum.
1. Check the currently installed PHP package
Yum List Installed | grep php
If you have a PHP package installed, remove them first
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
Configuring the Yum Source
Additional CentOS 6.5 Epel and Remi sources are added.
# RPM-UVH http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm # RPM-UVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
The following is the source for CentOS 7.0.
# Yum Install epel-release # RPM-IVH http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Use the Yum List command to view the installable packages (Packege).
# Yum list--enablerepo=remi--enablerepo=remi-php56 | grep php
Installing php5.6.x
The Yum source is configured, and the next step is to install PHP5.6.
# php-gd Php-redis
Installing PHP-FPM
The version installed here is PHP5.6.13.
Starting from PHP5.5, the PHP code cache has changed from APC to Zend Opcache.
Other sources:
2.Centos 5.X
RPM-UVH http://mirror.webtatic.com/yum/el5/latest.rpm 6. x -UVH/http// mirror.webtatic.com/yum/el6/latest.rpm 7-UVH https://mirror.webtatic.com/yum/el7/epel- -UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
If you want to remove the packages installed above, reinstall
Rpm-qa | grep webstatic
RPM-E The packages found above can be
3. Run Yum Install
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_64yum Install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
Note: If you want to upgrade to 5.6 the above 55w to 56w on it.
4. Install PHP FPM
Yum Install PHP55W-FPM
Note: If you want to upgrade to 5.6 the above 55w to 56w on it.
Centos 6.x/7.x Yum Installation php5.6.x (latest version)