Applications often fail with errors like "Class Imagick not found" or "intl extension missing". On cPanel, each PHP version is a separate EasyApache 4 build, so an extension must be installed for every version that needs it. This guide covers the two supported ways to do that and how to prove the extension loads.
Note: You buy one from cPanel or a partner and install it on your Linux VPS.
Before you start
- Root access to WHM and SSH on a cPanel server.
- The PHP version the site uses. Check WHM » Software » MultiPHP Manager.
- The exact extension name the application needs, for example
intl,imagick,redis,sodiumorgmp.
Always prefer an EasyApache 4 package when one exists. cPanel builds and updates it with the rest of PHP. Use PECL only when there is no package.
Option 1: EasyApache 4 in WHM
- In WHM, open Software » EasyApache 4.
- Next to Currently Installed Packages, click Customize.
- Open the PHP Extensions tab.
- Type the extension name in the search box, for example
intl. You see one package per PHP version, such asea-php82-php-intlandea-php83-php-intl. - Switch on the package for every PHP version your sites use.
- Go to Review, check the list of changes, then click Provision.
EasyApache installs the packages and restarts Apache and PHP-FPM. Sites stay online, but expect a short pause during the restart.
Option 1b: install the same packages from SSH
EasyApache 4 packages are normal system packages, so you can also install them with the package manager. This is handy for scripting.
AlmaLinux and Rocky Linux
dnf list available 'ea-php83-php-*' | grep -iE 'intl|imagick|redis'
dnf install ea-php83-php-intlUbuntu
apt update
apt search ea-php83-php 2>/dev/null | grep -iE 'intl|imagick|redis'
apt install ea-php83-php-intlSearch before you install. Package availability differs between PHP versions and operating systems, and some extensions are only available through PECL.
Restart PHP-FPM so the pools load the new extension:
/scripts/restartsrv_apache_php_fpmOption 2: PECL in WHM
If the extension has no EasyApache package, WHM can build it from PECL.
- In WHM, open Software » Module Installers.
- Click Manage next to PHP PECL.
- Choose the PHP version from the menu at the top.
- In Find a PHP PECL, search for the extension, for example
redis. - Click Install and wait for the build log to finish.
- Repeat for every PHP version that needs it.
PECL compiles the extension from source, so the server needs build tools. If the build fails, the log shows the missing library, such as ImageMagick development headers for imagick.
Warning: PECL builds are not updated by EasyApache. After a PHP minor update, check the extension still loads, and reinstall it from Module Installers if it does not.
Check it works
Each EasyApache PHP version has its own binary. List the loaded modules for the version your site uses:
/opt/cpanel/ea-php83/root/usr/bin/php -m | grep -iE 'intl|imagick|redis'Expected output:
imagick
intl
redisThe command line uses the same php.ini as PHP-FPM for that version, but to be certain the web side sees it, create a test file in the site's document root:
echo '<?php var_dump(extension_loaded("intl"));' > /home/USER/public_html/ext-test.php
chown USER:USER /home/USER/public_html/ext-test.phpOpen https://example.com/ext-test.php. It should print bool(true). Delete the file when you are done.
Troubleshooting
- Extension shows in
php -mbut the site still errors: the site runs a different PHP version. Check MultiPHP Manager and install the package for that version too. - PECL build fails with a missing header: install the development package for the library, for example
ImageMagick-develon AlmaLinux, then retry. Prefer the EasyApache package if one exists. - "Module already loaded" warning: the extension is enabled twice, for example by a package and a PECL build. Remove one of them and check the
.inifiles in/opt/cpanel/ea-php83/root/etc/php.d/. - Redis extension installed but connections fail: the extension is only the client. You still need a Redis server running and reachable.
- Provision fails in EasyApache: read the log it shows. Conflicts usually mean a package from another repository; remove it, then provision again.
Next steps
- Learn profiles and rollbacks: EasyApache 4 guide.
- Change PHP limits once extensions are in place: MultiPHP INI Editor.
- Pick a PHP version per domain: MultiPHP Manager.
