# EasyApache 4 PHP Versions 8.2 to 8.5: Install and Switch

Source: https://srvscripts.com/guides/easyapache-4-php-versions-8-2-8-5/
Updated: 2026-10-03
Publisher: srvScripts (https://srvscripts.com/)

EasyApache 4 packages every PHP version as a separate set of RPMs, so a cPanel server can run PHP 8.2, 8.3, 8.4 and 8.5 side by side and assign a different version to each domain. In late 2026, PHP 8.4 is the mainstream version, `ea-php85` is available for sites ready for it, PHP 8.1 is retiring, and PHP 8.2 reaches its security end of life on 31 December 2026. Knowing how to install, switch and remove versions cleanly is routine work, and this guide covers it from both WHM and the shell.

In short: Enable the versions and a matching extension set in WHM → EasyApache 4 → Customize, or install them with dnf install ea-php85 ea-php85-php-*, then set the default with whmapi1 php_set_system_default_version and move individual domains with…

**Short answer:** Enable the versions and a matching extension set in WHM → EasyApache 4 → Customize, or install them with `dnf install ea-php85 ea-php85-php-*`, then set the default with `whmapi1 php_set_system_default_version` and move individual domains with `whmapi1 php_set_vhost_versions`. Keep the extension list identical across versions so switching a site never produces a blank page, and remove a version only after `php_get_vhost_versions` shows no domain using it.

## Install versions through the EA4 interface

Open WHM → Software → EasyApache 4 and click Customize on the currently installed profile. The PHP Versions tab lists every version available from the EA4 repository for your OS. Enable the versions you want to offer, then move on to the PHP Extensions tab and pick the modules for each. A sensible baseline for a shared server is the same set on every version: `bcmath`, `curl`, `gd`, `imagick`, `intl`, `mbstring`, `mysqlnd`, `opcache`, `pdo`, `soap`, `xml`, `zip` and their dependencies. Review, then Provision. The provisioning log shows every package installed and any conflict.

Two things to keep in mind on the extensions tab. First, `ea-php85` may not yet have every third-party extension in the repository that 8.4 does; check that anything your customers depend on, especially ionCube Loader and Imagick, is listed before you announce the version. Second, some extensions are only useful with PHP-FPM or with a specific handler, and the interface will not warn you if you pick a combination that will be ignored.

## Install versions from the shell

The same job on the command line is quicker across many servers. Install a version and a matching extension set with `dnf`:

```
dnf -y install ea-php85 ea-php85-php-cli ea-php85-php-fpm \
  ea-php85-php-mysqlnd ea-php85-php-opcache ea-php85-php-mbstring \
  ea-php85-php-intl ea-php85-php-gd ea-php85-php-curl ea-php85-php-zip \
  ea-php85-php-xml ea-php85-php-soap ea-php85-php-bcmath
```

List which versions and packages are present:

```
dnf list installed 'ea-php*' | awk '{print $1}' | sort
/usr/local/cpanel/bin/rebuild_phpconf --current
```

To copy an existing version’s extension set to a new one, save the current profile, edit the version numbers in the JSON, and reprovision:

```
/usr/local/bin/ea_current_to_profile --output=/root/ea4-profile.json
sed -i 's/ea-php84/ea-php85/g' /root/ea4-profile.json
/usr/local/bin/ea_install_profile --install /root/ea4-profile.json
```

Check the profile before installing, because a straight substitution will fail if any 8.4-only package has no 8.5 equivalent.

## Set the system default and the handlers

WHM → Software → MultiPHP Manager shows the system default PHP version and the handler assigned to each installed version. The system default is what any domain “inheriting” gets, so be deliberate about changing it. Most servers should default to 8.4 today. Set it and the handlers from the shell with:

```
whmapi1 php_set_system_default_version version=ea-php84
whmapi1 php_set_handler version=ea-php84 handler=cgi
whmapi1 php_get_installed_versions
whmapi1 php_get_handlers
```

For performance, enable PHP-FPM for the versions your customers use. In MultiPHP Manager toggle “PHP-FPM” per domain or system-wide, or with `whmapi1 php_set_default_accounts_to_fpm value=1`. FPM keeps a warm pool per domain; the tuning of `pm.max_children` and OPcache is covered in [Enabling and tuning Apache + PHP-FPM on cPanel](/guides/apache-php-fpm-cpanel-php-fpm-tuning/).

## Switch a domain’s version

A customer can switch their own domain in cPanel → Software → MultiPHP Manager, and you can do it for them in WHM or from the shell:

```
whmapi1 php_set_vhost_versions version=ea-php85 vhost=example.com
whmapi1 php_get_vhost_versions | grep -B2 -A6 'example.com'
```

If a domain should follow the system default, set `version=inherit`. When many domains need to change at once, the bulk tool in cPanel 136 and later is far quicker; see [Using MultiPHP Manager and the bulk PHP-version tool](/guides/multiphp-manager-bulk-php-version/).

Per-domain `php.ini` overrides live in MultiPHP INI Editor, and with PHP-FPM they are written into the pool configuration at `/var/cpanel/userdata/<user>/<domain>.php-fpm.yaml`. After editing that file by hand, rebuild and restart:

```
/scripts/php_fpm_config --rebuild
/scripts/restartsrv_apache_php_fpm
```

## Remove versions you no longer need

Once no domain uses a version, remove it so it stops receiving updates and stops consuming space. Confirm first:

```
whmapi1 php_get_vhost_versions | grep -c 'ea-php81'
dnf -y remove 'ea-php81*'
```

If the count is not zero, move those domains before removing the packages, otherwise their sites will fail with a handler error. The guide on [retiring PHP 8.1 sites safely](/guides/retire-php-8-1-cpanel-tuxcare-els/) covers the audit and the customer communication side.

## Verify

Confirm each version answers and has the modules you expect:

```
for v in 82 83 84 85; do /opt/cpanel/ea-php$v/root/usr/bin/php -v | head -1; done
/opt/cpanel/ea-php85/root/usr/bin/php -m | grep -E 'opcache|mysqlnd|intl'
```

Then create a `phpinfo()` file under a test domain, switch that domain between versions with `php_set_vhost_versions`, and reload the page to watch the version change. Remove the file afterwards.

## Common pitfall

The most common support ticket after adding a new PHP version is “site shows a blank page after switching”. Almost always the new version is missing an extension the site depends on, typically `intl`, `imagick` or `ionCube`. Compare `php -m` between the old and new versions before offering the new one, and keep the extension lists identical across versions so that switching is predictable. The second trap is changing the system default without checking how many domains inherit it; that single click can move hundreds of sites at once.

## EasyApache 4 PHP versions at a glance

**Official documentation:** [cPanel & WHM documentation](https://docs.cpanel.net/), [Linux man pages](https://man7.org/linux/man-pages/).

**Related guides:** [Tuning InnoDB on MariaDB 11/12 for cPanel shared hosting: buffer pool, redo log and I/O](https://srvscripts.com/guides/innodb-tuning-mariadb-shared-hosting/) · [Choosing a VPS for a cPanel or DirectAdmin server in 2026](https://srvscripts.com/guides/best-vps-for-cpanel-directadmin-server/) · [High load on a cPanel server: finding the culprit with sar, top, Apache status and the MySQL slow log](https://srvscripts.com/guides/high-load-cpanel-server/).

## Frequently asked questions

### Does installing a new PHP version in EasyApache 4 affect existing sites?

No. Each version is a separate package set, and domains keep the version they were assigned or inherit until the system default is changed, so adding `ea-php85` is safe to do during the day.

### How long does switching a domain’s PHP version take?

A few seconds: `php_set_vhost_versions` rewrites the domain’s handler configuration and reloads Apache gracefully, and with PHP-FPM the new pool starts immediately, so the change is visible on the next page load.

### Can I undo this?

Yes. Switch the domain back with `whmapi1 php_set_vhost_versions`, restore the previous system default, or reinstall a removed version’s packages from the EA4 repository; keeping a saved profile from `ea_current_to_profile` makes the rollback a single command.
