Home About Me

When an Old CMS Pushes You Back to PHP 5.5

PHP 7 had been running well on the ECS instance. Then a recent project landed on the same server. It was for an acquaintance, and the fee was roughly equal to the server cost, so the blog could stay there without adding much to the bill. The problem was the CMS: it does not support PHP 7. During installation it asked for the sql extension to be enabled. A quick search showed that the sql extension was removed starting with PHP 7, which meant the only realistic fix was to downgrade PHP.

LNMP turned out to support that. Its documentation says versions from 1.3 onward can usually perform a PHP downgrade. Even so, doing it on a live server felt like a risk.

The process took two steps:

  1. In the lnmp directory, run: ./upgrade.sh php
  2. Enter the PHP version. At the time, the lowest version available for download was 5.5.38.

After that the script ran by itself. About 20 minutes later PHP had been downgraded. Running php -v showed 5.5.38, so it worked on the first attempt. With the CMS compatible again, the setup should be fine for the next three years.

Backing up data before a downgrade is essential. There were not many blog posts, but every word had been written painstakingly, and the comment data mattered just as much. If the downgrade had failed, the fallback would have been to reinstall the system and restore the data.

One unrelated issue is still hanging around: the blog has HTTPS but does not support HTTP/2. Many guides say to upgrade OpenSSL, but several attempts have not succeeded. A clear, concrete procedure for that would be welcome.