As Jacob mentioned, the CentOS packages repo appears to only have PHP 5.3 available at the moment. But these commands seemed to work for me…
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm yum remove php-common # Need to remove this, otherwise it conflicts yum install php56w yum install php56w-mysql yum install php56w-common yum install php56w-pdo yum install php56w-opcache php --version # Verify version has been upgraded
You can alternatively use
php55w if required.
This may potentially break your website if it doesn’t fully resolve all your dependencies, so you may need a couple of extra packages in some cases. See here for a list of other PHP 5.6 modules that are available.
If you encounter a problem and need to reset back to the default, you can use these commands:
sudo yum remove php56w sudo yum remove php56w-common sudo yum install php-common sudo yum install php-mysql sudo yum install php
(Thanks Fabrizio Bartolomucci)