A PHP version jump during a cPanel migration is the part of the move that bites applications. Going from PHP 7.4 to PHP 8.2 brings type strictness changes, removal of long-deprecated functions, and changed default values that production applications often did not test against. The fix is not “fix PHP” — it is to test before cutover and pin per-domain PHP versions where needed.
What’s happening
cPanel’s MultiPHP Manager lets each domain run its own PHP version independently. On the source, every domain might run PHP 7.4. On the destination, the new install may default to PHP 8.2. The transfer copies the application files but does not pin the PHP version unless you do it. Without pinning, the destination uses its default. Applications that worked under 7.4 may emit fatal errors on 8.x: removed function (each), tightened type checks (passing null to a typed argument), or character handling changes.
How to verify
Audit the source’s PHP usage:
# source: which version each domain uses
whmapi1 php_get_vhost_versions
# what PHP versions are installed on the source
ls /opt/cpanel/ | grep ea-php
# application's declared PHP requirement
grep -ri "php.*version\|composer.json" /home/<user>/public_html | head
On the destination after transfer:
# what PHP versions are available
ls /opt/cpanel/ | grep ea-php
# what version each domain is set to
whmapi1 php_get_vhost_versions
# default PHP for new accounts
whmapi1 php_get_system_default_version
The fix
- Pin per-domain PHP on destination — for each transferred account, set the PHP version explicitly:
whmapi1 php_set_vhost_versions vhost-0=example.com version-0=ea-php74. Do this before users hit the destination. - Install the source’s PHP version on the destination — if the destination is missing PHP 7.4, the only way to keep applications running is to install it. WHM > EasyApache 4 > Provision a profile that includes the older PHP version. Treat it as a temporary measure with a sunset date.
- Run the application against the destination’s default — in staging, hit every major route with
curl --resolveagainst the destination IP. PHP fatals show in the error log; collect them, fix in code, re-test. - Composer dependencies — for Composer-managed projects,
composer outdatedandcomposer install --no-devagainst the destination’s PHP. Dependencies that pinned PHP 7.x compatibility may need upgrades. - WordPress and plugins — WordPress 6.x supports PHP 8.x but specific plugins do not. Test with WP-CLI:
wp plugin status --field=name --status=active | xargs -I {} wp eval "echo 'OK';"to surface fatals.
The longest tail is custom code from a previous developer that never anticipated a PHP upgrade. Plan for a budget to fix what surfaces. Stack Harbor handles PHP version-jump migrations under migration solutions — book a migration review before the version pin choice is final.