I like CentOS very much. I used to be an ardent Slackware user, but I never regretted switching to CentOS when I built my new servers a couple of years ago.

But CentOS unfortunately comes with an ancient version of PHP, version 5.4. Support for this version ended quite a while ago, and apart from the obvious security issues, it means a growing list of incompatibilities with Web-based applications like content management systems.

I tried a dramatic skip over versions and install PHP 7.3, only to realize that it breaks a lot of my legacy code, especially code that relies on the old, no longer supported mysql_ library calls. Sure, there may be patches that reinstate the old library, but that would represent a step in the wrong direction, and besides, who will continue supporting those patches and old libraries?

So the long-term solution is definitely an upgrade to PHP 7.x, which means fixing a lot of my legacy code.

But in the short term, what do I do?

Today, I found out that upgrading to PHP 5.6 (for which official support ended only recently, and which is still supported by most Web software) is a lot less painful than I feared. In fact, an almost mechanical execution of the following steps did the trick on all my servers:

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php56
yum update
systemctl restart httpd

Lovely, I say. Now I can go back and continue ripping out all that old mysql_ stuff from my server-side code until I am finally ready for a PHP 7.x upgrade.