EasyApache 4 (EA4) ships every supported PHP build as a separate set of RPMs, so adding a new version is a package install plus a handler change — not a recompile. The friction is everywhere else: extensions that fail to provision, the Review stage that sits at 0% for ten minutes, and domains that keep loading the old PHP after the install completes.
This guide walks the full install on a cPanel/WHM server, the extensions you almost always want, and the three places you have to look when something silently keeps using the old version.
Add the new PHP build
Open WHM → Software → EasyApache 4 → Customize on the currently provisioned profile, then click PHP Versions and tick the box for the new build (for example ea-php83). The CLI equivalent is one yum transaction:
yum -y install ea-php83 ea-php83-php-cli ea-php83-php-common
Installing only the meta package gives you a working interpreter with no extensions. Add the extension RPMs in the same transaction — pulling them in later forces a second php-fpm restart per domain.
Extensions to include by default
For a general-purpose cPanel server, these match what most WordPress, Laravel, and Magento sites expect:
yum -y install \
ea-php83-php-bcmath ea-php83-php-curl ea-php83-php-gd \
ea-php83-php-imagick ea-php83-php-intl ea-php83-php-mbstring \
ea-php83-php-mysqlnd ea-php83-php-opcache ea-php83-php-pdo \
ea-php83-php-soap ea-php83-php-sodium ea-php83-php-xml \
ea-php83-php-zip
If you run hardened PHP for legacy sites, the alt-php packages install in parallel and do not conflict.
Survive the Review stage
The Review stage is where EA4 calculates the dependency graph before applying. On a busy server it can sit at 0% for several minutes, then complete in a burst. It is not stuck unless /var/log/cpanel/easy/apache/build.log shows an actual error.
If Review fails with Error: package conflicts, the usual cause is a stale ea-php-cli or a third-party EPEL php RPM pulled in by Webmin or another tool. Resolve it before retrying:
yum list installed | grep -E '^(php|ea-php)'
yum -y remove php-cli php-common # the non-ea4 ones, if present
Assign the new PHP to a domain
A new build is installed but not selected. Set the system default and the per-domain handler:
whmapi1 php_set_system_default_version version=ea-php83
whmapi1 php_set_vhost_versions version=ea-php83 vhost=example.com
Or in WHM go to MultiPHP Manager, set the System PHP Version, then tick the affected domains and switch the version column. End users with the PHP Selector can override per-account from cPanel.
Rebuild and verify
/scripts/restartsrv_apache_php_fpm
curl -sI https://example.com/info.php | grep -i x-powered-by
Drop a one-line phpinfo() file in the docroot, hit it, then delete it. If the response still shows the old version, check the three usual suspects in order.
Why domains still load the old PHP
- PHP-FPM was not restarted for that pool. EA4 restarts FPM globally, but
whmapi1 convert_all_maildirsand similar long-running tasks can leave a pool stuck. Run/scripts/restartsrv_apache_php_fpmagain and confirmsystemctl status ea-php83-php-fpmshows the right PID. - The
.user.inior.htaccesspins the version. A line likeAddHandler application/x-httpd-ea-php82___lsphp .phpoverrides MultiPHP Manager. Grep the docroot:grep -RInE 'x-httpd-ea-php[0-9]+' /home/*/public_html | head. - The CloudLinux PHP Selector wins. If the account has PHP Selector configured, the alt-php version takes precedence over the EA4 handler. Switch the selector to "native" or set it to the matching alt-php build.
Remove an old PHP version
Only remove a build once no vhost references it. WHM's MultiPHP Manager shows which version each domain runs; the API equivalent:
whmapi1 php_get_vhost_versions | grep -B1 ea-php74
yum -y remove 'ea-php74-*'
Keep one prior version installed for a release cycle so you can fall back if a customer reports a regression. Re-add later costs a few seconds; debugging a broken WooCommerce checkout costs a lot more.
Why is EasyApache 4 stuck at Review?+
Do I need to restart Apache after adding a PHP version?+
How many PHP versions can I install on one cPanel server?+
Why does my site still show the old PHP version in phpinfo?+
Next steps
- Restrict per-account PHP versions with the CloudLinux PHP Selector.
- Compare the PHP handlers available in cPanel before pinning a domain to PHP-FPM.
- Need a fresh cPanel install to test on? See install cPanel on a VPS, or buy a cPanel license.