upgrade

Upgrading PHP to 5.6 in linux Centos 6

Posted by admin on March 27, 2016
Php / No Comments

Php by default in Centos 6 may be versión 5.3. If you want to make the most of php with useful functions lie hex2bin, you need the 5.6 version.

In order to upgrade, first we must add the repo, then remove the current version and finally install the new version.

This script contains the commands needed to carry out the tasks:

sudo rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
sudo yum remove php-common
sudo yum install php56w
sudo yum install php56w-mysql
sudo yum install php56w-common
sudo yum install php56w-pdo
sudo yum install php56w-opcache
sudo yum install php56w-pgsql
sudo yum install php56w-pear
sudo yum install php56w-mcrypt
sudo yum install php56w-xml
sudo yum install php56w-xmlrpc
sudo yum install php56w-devel
sudo yum install php56w-pecl-memcache
sudo yum install php56w-gd
sudo yum install php56w-pspell
sudo yum install php56w-snmp
php --version               

With the last line we can verify the success of the upgrade.

Happy coding! 🙂

Tags: , , , , ,