HardenedPHP: Running Old PHP Versions Without the Security Debt

What CloudLinux HardenedPHP patches in end-of-life PHP 5.6 to 8.1, how updates arrive, what it cannot fix, and a plan for moving customers to supported PHP.

Published
Reading time
4 min

Every hosting server has at least one site that cannot move off an old PHP. The developer left, the plugin was never updated, the shop runs on a framework whose last release was in 2017. PHP 7.4 stopped receiving security fixes at the end of 2022, 8.0 a year later and 8.1 at the end of 2025, so those sites are running interpreters with known, published vulnerabilities. HardenedPHP is CloudLinux's answer: they keep patching the versions the PHP project has abandoned. This post covers what that gives you, where it stops, and how to use it as a bridge rather than a place to live.

What HardenedPHP is

CloudLinux maintains its own PHP builds, the alt-php packages that PHP Selector offers to users. For the versions still supported upstream those builds track php.net releases. For the versions that are not, currently 5.6 through 8.1, CloudLinux's engineers take the security fixes published for current PHP, work out whether the same code exists in the old version, and backport the fix. The result ships as a normal package update.

There is nothing to install or license separately. If you have PHP Selector, you have HardenedPHP, and the version list in CloudLinux Manager → Selector → PHP is the list of what it covers. The panel's native PHP is not part of it; only the alt-php interpreters carry the backports.

How updates arrive

They come through yum like everything else on the server, so a server on automatic updates receives them without anyone doing anything:

bash
yum update 'alt-php*'
rpm -q --changelog alt-php74 | head -20

The changelog is the useful part: each entry names the CVE that was backported, which is what you show a customer, or a compliance auditor, who asks what "hardened" actually means. Run cagefsctl --force-update after updates so the patched binaries reach every user's cage; a server that updates alt-php nightly should have that in the same cron.

The honest limits

HardenedPHP fixes the interpreter. It does nothing for the application running on it, and on a legacy site the application is usually the bigger risk. A WordPress plugin last updated in 2019 has the same holes on hardened 7.4 as on stock 7.4. Old Magento 1, Joomla 3, CodeIgniter 2: their security bugs are theirs, and no PHP patch closes them.

A few more things it does not change. Old PHP is slow: PHP 7 roughly doubled the speed of 5.6 and each 8.x release has added more, so a site that stays on 7.4 pays in CPU, which on CloudLinux means LVE faults it need not have. Old extensions stay old, so a site depending on mcrypt still has mcrypt, and libraries pinned to that PHP stay pinned. And external scanners read the version string: a PCI scan sees 7.4.33 and flags it whatever the changelog says, in the same way Debian's backported packages get flagged, so expect to produce the changelog for anyone who needs the evidence.

Then there is the ceiling. CloudLinux backports fixes where the vulnerable code exists in the old version and the fix applies cleanly. That covers most CVEs, but not a bug in a feature the old version never had, and eventually the code has drifted so far that a backport is impractical. Support for a version does not last forever; 5.6 is now more than a decade old.

Using it well with PHP Selector

Three settings make the difference between a bridge and a trap. In CloudLinux Manager → Selector → PHP, keep the default version on a release with upstream support, 8.3 or 8.4 today, so new accounts never start on a hardened version by accident. Leave 7.4, 8.0 and 8.1 enabled for the accounts that need them. Disable 5.6 through 7.3 unless a named customer depends on one, because every enabled version is one a user can pick from a dropdown without knowing what it means.

Then find out who is on what. cloudlinux-selector get --json --interpreter php --user <user> reports one user's selection; loop it over the accounts on the server and you have the list:

bash
for u in $(ls /home); do
  v=$(cloudlinux-selector get --json --interpreter php --user "$u" 2>/dev/null | grep -o '"selected_version": *"[^"]*"' | cut -d'"' -f4)
  echo "$u $v"
done | sort -k2

Anyone on a hardened version is a customer to talk to, not a problem solved.

A plan for getting off old PHP

The plan that works is short and repeated per site. Clone or stage the site: DirectAdmin's WordPress Manager does this in a click for WordPress, and a subdomain with a copied database does it for anything else. Switch the copy to 8.2 or newer in Select PHP Version and use it, with display_errors on in the selector's options for the copy only. What breaks is almost always the same few things: a deprecated function removed in 8.0, a plugin using each() or create_function(), a theme with ${var} string syntax. Fix or replace those, confirm the copy works, and switch the live site, keeping the old version enabled for a week so the rollback is one dropdown.

Give customers a date. "7.4 is switched off on this server on 1 December" moves more sites than any number of reminders that it is a good idea. HardenedPHP buys the time to do this properly, one site at a time, instead of on the day an exploit lands. What to check on the DirectAdmin side of the change, including php.ini differences between versions, is in changing the PHP version and settings in DirectAdmin.

The right way to think about it is insurance you are paying for already. Use it, keep the changelog handy, and set a date for every site that depends on it.

#cloudlinux#php#hardenedphp#security

Keep reading

More from CloudLinux

All guides

CloudLinux

mod_lsapi: The Fastest PHP Handler for Apache on CloudLinux

Why mod_lsapi beats suPHP, fcgid and PHP-FPM on a shared CloudLinux server, how to switch to it on DirectAdmin and cPanel, and the directives worth tuning.

5 min read →

CloudLinux

CloudLinux PHP Selector: A PHP Version and Extensions Per Account

How CloudLinux PHP Selector gives each account its own PHP version, extensions and php.ini values, what it needs on DirectAdmin, and the CLI to manage it.

5 min read →

CloudLinux

CageFS: What It Does and How to Enable It on CloudLinux

Why every CloudLinux server should run CageFS, what it hides from users, how to initialise and enable it, and how to fix the usual breakages.

4 min read →