Skip to content

Server-wide migration off an EOL PHP version on cPanel

How to plan a fleet-wide PHP version migration on a cPanel server before the EOL date — including inventory, customer-facing communication, and the rollback path per account.

Every cPanel server eventually has accounts pinned to a PHP version that is about to fall out of support. Some operators wait for the cPanel-shipped removal of the EA4 package set and migrate under duress. The cleaner pattern is a 90-day migration with a stop-and-rollback gate per account, scheduled against the published PHP EOL date rather than the day the server stops booting.

What’s happening

PHP versions enter “security support only” for one year after their feature-support cutoff, then drop entirely. The ea-php<ver> package set in cPanel’s EA4 repo follows the upstream schedule with a small grace period. Once the package set is dropped, yum update on the cPanel server will remove the old PHP binary. Any account still pointed at it falls back to the default server PHP version mid-update, which is the bad outcome.

How to verify

Inventory accounts by PHP version:

whmapi1 --output=json php_get_vhost_versions | jq -r '.data.versions[] | "\(.version) \(.account) \(.vhost)"' | sort
rpm -qa | grep ea-php | awk -F'-' '{print $2}' | sort -u

Cross-reference each account on the EOL version against your customer registry: when did you last talk to them, who is their developer contact, what does the app run on.

The fix

  1. Pull the inventory. Group accounts into three buckets: vanilla WordPress (low-risk migration), framework apps with active developers (need to coordinate), and bespoke apps with no developer reachable (high-risk, may need code work).
  2. For the WordPress bucket, schedule a batch migration over a maintenance window. Per account: take a JetBackup snapshot, switch via WHM > MultiPHP Manager, validate front page and admin, move to next.
  3. For the framework bucket, send a 60-day notice to the developer contact with the new PHP version, the EOL date for the current version, and an offer to schedule a test on a staging account. Track responses; escalate at 30 days, 14 days, and 7 days.
  4. For the bespoke bucket, schedule a code review session. Identify any deprecation that will bite (PHP 8 removed each(), PHP 8.1 deprecated implicit nullable, PHP 8.2 deprecated dynamic properties). If the customer cannot pay for the code work, document that and decide whether to keep them on a now-unsupported PHP version under explicit risk acknowledgment.
  5. For each migration, the per-account rollback is the same whmapi1 php_set_vhost_versions call to the prior version. Practice it on a staging account once before the batch.
  6. After the EOL date, leave the old PHP package set installed for 30 more days. cPanel may auto-remove it on the next major update; if you preserved a yum versionlock, the package stays available. Use that grace period to chase the last accounts.

For environments where PHP EOL is a regular event, Stack Harbor runs the inventory-notice-migrate cycle for the entire fleet under managed cPanel operations.