Upgrade PHP From 5.1.6 to latest on CentOS 5.6Jun 11, 2011

Default PHP version on CentOS 5.6 is 5.1.6, in order to use any functionality avaiable above 5.1.6 (such as Nowdoc strings etc.) you must have to upgrade PHP. In the following article I will explain how easily we can upgrade PHP (to latest version) on CentOS. In this post I will use yum to upgrade PHP by using REMI (3rd party) repository.

Yum (Yellow dog Updater) is the default package manager used in all CentOS versions. It is used to install and update packages from CentOS or any other 3rd party repositories.

Now let's start some action :)

Download and install EPEL and REMI repositories

Login as root and go to directory /usr/src and download the following RPMs:

$ cd /usr/src
$ wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
$ wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
$ rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Upgrade PHP

$ yum update php php-* --enablerepo=remi

Restart Apache

$ service httpd restart

Check if everything is fine

$ php -v

Thats all :)

blog comments powered by Disqus
Me Hi! My name is Zeeshan Muhammad Khan (nick name Shan) and I am a software engineer, database developer, web developer, programming geek, statistics geek, mathematics geek, system analyst and maintainer of this site. read more

Web Shelf