Friday, June 19, 2015

How to Upgrade PHP 5.4.X TO 5.5.X OR 5.6.X on CentOS 6.X


Step 1 - Check the system OS and Hardware information.

Step 2 - Check the current version of Apache, PHP and MySql.
   And also check PHP dependency versions.

Step 3 - Add EPEL and Remi repositories into your server :

On CentOS 6.x 32-bit :
     wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
     wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
     rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

On CentOS 6.x x86_64 (64-bit) :
     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 -Uvh remi-release-6*.rpm epel-release-6*.rpm

Step 4 - After installing, check the repository is added or not.

Step 5 -  Now enable your newly added Remi repository. Open the /etc/yum.repos.d/remi.repo file using a text editor.

Edit enabled=0 line to enabled=1    => Select the version which you want to enable, go to that PHP version and enable 1. Here I am upgrade version php56.

Step 6 -After enabling "php56", we can upgrade php version by using below command.
   yum --enablerepo=remi,remi-php56 update php\*

Step 7 - After all we can check the PHP and PHP dependency version.

Step 8 - Now restart the Apache server.

Step 9 - We can also check the version in phpinfo.php file.

That's it...

No comments:

Post a Comment