Upgrading PHP 5.3 to 5.6 (CentOS 6.8)
We are running CentOS 6.8, which comes with php v5.3 which is out of date now. How do we upgrade to v5.6?
The official CentOS 6 repos don't have anything above v5.3, however it appears there are some third party repos that offer 5.6 (and above).
In researching this, I deployed a Linode with CentOS 6.8 and installed PHP:
yum install php php -v PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)
I found this guide that details upgrading to 5.6 from 5.3
After following the steps to install the remi repos and editing the .repo file as directed, I did the upgrade:
yum -y upgrade php*
And checked again
php -v PHP 5.6.40 (cli) (built: Jul 3 2019 07:08:28)
So, this guide worked very easily for getting to 5.6 for me. I'm not sure what your particular requirements are for going to 5.6, but these repos will allow for upgrade to a more recent version as well.
I followed this guide to upgrade to v7.0
yum install yum-utils
After installing yum-utils, I upgraded to 7.0 (the other options like 7.1 also worked for me)
yum-config-manager --enable remi-php70 yum -y upgrade php* php -v PHP 7.0.33 (cli) (built: Jul 2 2019 18:47:44) ( NTS )
Hopefully this helps!