Skip to content

Account-level checklist for a PHP version upgrade on cPanel

A pre-flight checklist to run before moving a single cPanel account from one PHP version to the next — covering extensions, deprecations, .user.ini values, and PHP-FPM pool regeneration.

A PHP minor-version bump on a quiet WordPress site is fine. A major-version bump on a custom application is a project. The accident waiting to happen is the in-between case: a customer’s app that “should be fine” but uses one deprecated function, one extension that did not get installed on the target version, or one php.ini directive that was renamed. The checklist below catches those cases before the customer does.

What’s happening

Each ea-php<ver> package set is fully independent on disk: separate binary, separate extension tree, separate php.ini, separate FPM service. Switching an account from ea-php81 to ea-php82 does not migrate the per-version configuration overlay. The MultiPHP INI Editor’s per-account overlay does carry over (it lives in /var/cpanel/users/<user>/php.ini), but extensions and per-version overrides do not.

How to verify

Pre-flight for the account:

whmapi1 php_get_vhost_versions vhost=example.com
rpm -qa | grep ea-php81-php- | awk -F'-' '{print $4}' | sort -u
rpm -qa | grep ea-php82-php- | awk -F'-' '{print $4}' | sort -u
diff <(rpm -qa | grep ea-php81-php- | awk -F'-' '{print $4}' | sort) <(rpm -qa | grep ea-php82-php- | awk -F'-' '{print $4}' | sort)
cat /home/<user>/public_html/.user.ini 2>/dev/null

The diff is the most important command — it lists extensions present on the old version but not on the new one.

The fix

  1. Resolve the extension diff. Any extension on the diff list that the application actually uses needs to be installed on the new version: yum install ea-php82-php-<extension>. Common gotchas: ea-php<ver>-php-imap and ea-php<ver>-php-mcrypt were not auto-installed in some EA4 builds.
  2. Check the application against the target PHP version’s removals. PHP 8.0 removed each(), magic quotes were already gone, mcrypt is gone, assert() semantics changed. PHP 8.1 deprecated implicit nullable types. PHP 8.2 deprecated dynamic properties. Each requires either a code fix or an explicit suppression.
  3. Read the .user.ini files in the account: find /home/<user>/ -name ".user.ini" -exec cat {} \;. Confirm none of them set a directive that the new version renamed or removed.
  4. Switch the version: WHM > MultiPHP Manager > set domain to ea-php82. cPanel regenerates the FPM pool config under the new version. The old pool’s config under /opt/cpanel/ea-php81/root/etc/php-fpm.d/ remains until you remove it; that is fine.
  5. systemctl reload ea-php82-php-fpm. Confirm the pool started: systemctl status ea-php82-php-fpm | head.
  6. Test from the customer’s perspective. Specifically hit the admin area, any form that POSTs large data, and any cron-driven page. Watch error_log for deprecation notices — E_DEPRECATED is on by default in cPanel builds.
  7. If you find an issue, switch back: same UI, set the version to ea-php81. The pool regenerates; downtime is the seconds needed for the reload.

For environments where dozens of accounts move PHP versions per quarter, Stack Harbor handles the checklist and the validation pass under cPanel/WHM management.