We saw how to install/upgrade php-5.1.6 to php-5.3.3 using YUM on CentOS/Fedora/RHEL. Today we shall see how to Install/Upgrade php to 5.5 from Remi repository using YUM. The Remi(Les RPM de Remi) repository provides the latest version of various software packages related to php and mysql for redhat based linux distros like CentOS, Fedora and RHEL. This repository helps for those who intend to setup apache+php based web servers with various kinds of open source applications. This repository is used because the default CentOS/fedora distros do not have the latest versions of these packages! Know more on Remi repository. The repository can be easily setup on CentOS/Fedora through the rpm installer which will setup the repository configuration.
Also Read : How to Upgrade PHP 5.x to PHP 7 using Yum?
Step1: How to configure Remi repository in CentOS/Fedora/RHEL
Setup on CentOS/RHEL – 5.x/6.x
The Remi rpm installer is available for both 5.x and 6.x versions of CentOS. The URLs are as follows:
CentOS/RHEL 5.x - http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
CentOS/RHEL 6.x - http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
On CentOS, the Remi repository is dependent on Epel repository, which needs to be installed first. Download both remi and epel installer rpms as shown below:
CentOS/RHEL 5.x
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uhv remi-release-5.rpm epel-release-5-4.noarch.rpm
CentOS/RHEL 6.x
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uhv remi-release-6.rpm epel-release-6-4.noarch.rpm
Note: If you already have epel repo installed, then need not install epel rpm!
Setup on Fedora 18/19
On Fedora, Remi depends on the RPMfusion repository. Firstly we need to setup the rpmfusion repository as shown below:
Fedora 17/18/19
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
After rpmfusion is installed, move ahead to setting up Remi repository.
Fedora 20
rpm -Uvh http://rpms.famillecollet.com/remi-release-20.rpm
Fedora 19
rpm -Uvh http://rpms.famillecollet.com/remi-release-19.rpm
Fedora 18
rpm -Uvh http://rpms.famillecollet.com/remi-release-18.rpm
Fedora 17
rpm -Uvh http://rpms.famillecollet.com/remi-release-17.rpm
Make sure to use the correct url for your Fedora version. Thats it! Now the remi repository has been configured on your system.
Step 2: Verify Remi repository
By default, Remi repository would be disabled. If you want to enable it permanently, open the file /etc/yum.repos.d/remi.repo and change the value of enabled from 0 to 1.
vim /etc/yum.repos.d/remi.repo
You can also enable temporarily using yum commands.
Step 3: Install/Upgrade PHP to version 5.5
Firstly remove the older php installation using yum remove command as shown below:
yum remove php php-cgi php-cli php-common
Now install PHP5.5 using yum by issuing the below command:
yum --enablerepo=remi,remi-php55 install php
The above command enables remi repository temporarily to install php5.5
Step 4: Verify the PHP version
Verify the latest installed php version using below command:
php --version
Below video shows the step-by-step procedure of the above installation: