Overview
WHM PHP configuration is something you’ll touch constantly as a server admin — whether you’re pushing a client from PHP 7.4 to 8.2, bumping up upload_max_filesize for a WooCommerce store, or enabling the intl extension for a Laravel app. Getting it wrong can break sites instantly, so it’s worth understanding how WHM handles PHP before you start clicking.
WHM uses EasyApache 4 (EA4) as its PHP and web server configuration tool. EA4 replaced the old EasyApache 3 pipeline back in 2016, and if you’re still on EA3, you’re running something that’s been end-of-life for years. EA4 lets you install multiple PHP versions side by side and assign them per account or per directory — which is genuinely useful when you’re managing a mix of legacy and modern applications on the same server.
This article covers the full WHM PHP configuration workflow: installing PHP versions via EasyApache, assigning them to accounts, adjusting PHP directives, and enabling extensions. It applies to WHM 110+ running EasyApache 4 on CloudLinux or standard CentOS/AlmaLinux setups.
Prerequisites
- Root or reseller access to WHM (resellers have limited PHP controls — see the Reseller Hosting page for capability differences between plans)
- EasyApache 4 installed on the server (standard on all modern cPanel/WHM installs)
- WHM version 110 or later recommended
- SSH access is optional but useful for verifying changes — not required for the steps below
- A clear list of which PHP version(s) your hosted sites actually need before you start
Step-by-Step Instructions
Step 1: Install PHP Versions via EasyApache 4
Before you can assign a PHP version to any account, it has to be installed on the server. WHM doesn’t install all PHP versions by default.
- Log in to WHM as root.
- In the left sidebar search box, type EasyApache 4 and click it under the Software section.
- You’ll land on the EasyApache 4 dashboard. Click Customize next to the Currently Installed Packages profile.
- Click the PHP Versions tab at the top of the package list.
- Toggle on any PHP version you need — for example, ea-php82 for PHP 8.2 or ea-php81 for PHP 8.1. You can install multiple versions simultaneously.
- Click Review, then Provision. The build process runs in the background and usually takes 2–5 minutes.
📝 Note: EA4 package names follow the pattern ea-phpXX where XX is the major/minor version without the dot. PHP 8.2 = ea-php82, PHP 7.4 = ea-php74.
You can also install PHP versions directly via the command line if you prefer:
yum install ea-php82 ea-php82-php-cli ea-php82-php-fpm ea-php82-php-mysqlnd ea-php82-php-opcache
⚠ Warning: Don’t remove a PHP version that’s currently assigned to live accounts. WHM won’t always warn you before it breaks those sites.
Step 2: Assign PHP Versions to Accounts Using MultiPHP Manager
Once your PHP versions are installed, use MultiPHP Manager to assign them per account or per domain.
- In WHM, search for MultiPHP Manager and open it (under the Software section).
- You’ll see a list of all cPanel accounts on the server with their current PHP version shown.
- Check the box next to one or more accounts you want to update.
- In the PHP Version dropdown at the top, select the target version (e.g., ea-php82).
- Click Apply.
📝 Note: Account-level PHP version assignments in MultiPHP Manager set the version for the account’s primary domain. Individual cPanel users can override this per directory via a .htaccess rule or their own MultiPHP Manager interface — assuming you’ve allowed it in MultiPHP INI Editor settings.
Step 3: Configure PHP Directives via MultiPHP INI Editor
This is where you adjust the actual PHP settings — memory limits, file upload sizes, execution time, error reporting, and so on.
- In WHM, search for MultiPHP INI Editor and open it.
- At the top, select the PHP version you want to edit from the dropdown (e.g., php 8.2). These settings apply globally to that PHP version across all accounts using it, unless overridden at the account level.
- You’ll see two tabs: Basic Mode and Editor Mode.
- Basic Mode shows a small set of the most commonly changed directives with a simple UI. Good for non-technical adjustments.
- Editor Mode exposes the full
php.inias a text editor. Use this for anything not listed in Basic Mode.
- Make your changes and click Save.
Common directives and recommended values for a typical WordPress or WooCommerce hosting environment:
memory_limit = 256M
max_execution_time = 120
max_input_time = 120
upload_max_filesize = 64M
post_max_size = 64M
max_input_vars = 3000
display_errors = Off
log_errors = On
⚠ Warning: Setting memory_limit too high on a shared or VPS environment can allow a single account to starve other sites of RAM. On our VPS plans, I’d recommend setting a reasonable ceiling per PHP version and using CloudLinux LVE limits as a secondary guardrail if available.
Step 4: Enable or Disable PHP Extensions
Some applications require specific PHP extensions that aren’t enabled by default — intl, imagick, soap, or redis are common ones.
- Go back to EasyApache 4 in WHM and click Customize.
- Click the PHP Extensions tab.
- Use the search box to find the extension you need. Extensions are prefixed by PHP version — for example,
ea-php82-php-intl. - Toggle the extension on and click Review, then Provision.
Alternatively, from the command line:
# Install the intl extension for PHP 8.2
yum install ea-php82-php-intl
# Verify it loaded
/opt/cpanel/ea-php82/root/usr/bin/php -m | grep intl
📝 Note: After installing an extension via CLI, you may need to restart PHP-FPM for the change to take effect on accounts using FPM mode:
systemctl restart ea-php82-php-fpm
Step 5: Verify the PHP Configuration
Always verify your changes actually landed. The fastest way is a quick CLI check:
# Check active php.ini values for PHP 8.2
/opt/cpanel/ea-php82/root/usr/bin/php -i | grep -E "memory_limit|upload_max|post_max|max_execution"
If you want to verify from the browser side, create a temporary phpinfo file in a test account’s public directory:
<?php phpinfo(); ?>
⚠ Warning: Delete this file immediately after checking. A publicly accessible phpinfo() output exposes server path information, loaded modules, and environment variables — all useful to an attacker.
Common Issues & Troubleshooting
PHP version shows correctly in WHM but sites still run the old version
This usually means the site is overriding the version via a .htaccess file or a local php.ini / .user.ini in the document root. Check for these:
find /home/username/public_html -name ".htaccess" -o -name "php.ini" -o -name ".user.ini" | xargs grep -l "php" 2>/dev/null
A .htaccess line like AddHandler application/x-httpd-php74 .php will lock the directory to PHP 7.4 regardless of what MultiPHP Manager says.
PHP-FPM returning 503 errors after a version change
If you switched an account to a PHP version that doesn’t have PHP-FPM installed or running, Apache can’t hand off requests and returns a 503. Check the FPM service status:
systemctl status ea-php82-php-fpm
journalctl -u ea-php82-php-fpm --since "10 minutes ago"
If it’s not running, start it and check for config errors. A common cause is a pool config file with a syntax error after a manual edit.
Memory limit changes in MultiPHP INI Editor aren’t taking effect
WordPress and some other apps set their own memory_limit in wp-config.php or via a plugin. The application-level setting can override the server-level php.ini. Check wp-config.php for:
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');
Also, if the account is running under CloudLinux LVE, the LVE memory limit caps the effective ceiling regardless of what php.ini says. Check LVE limits in WHM under Manage Resellers > CloudLinux LVE Manager.
Extension installed but PHP still says it’s not loaded
This is annoyingly common when mixing CLI and FPM contexts. The CLI binary and the FPM process can use different php.ini paths. Confirm which ini file the web-facing FPM process is reading:
# Check the FPM-specific ini directory
ls /opt/cpanel/ea-php82/root/etc/php.d/
The extension’s .ini file should appear there (e.g., 40-intl.ini). If it’s missing, the yum install may have failed silently. Re-run the install and check for errors.
EasyApache 4 provisioning fails mid-build
EA4 builds can fail if the server is low on disk space (it needs at least 1–2 GB free in /usr and /tmp) or if a package dependency conflict exists. Check available space first:
df -h /usr /tmp /var
Then check the EA4 build log for the actual error:
cat /var/log/cpanel/easy/apache/build.log | tail -50
FAQ
Frequently Asked Questions
Can I run multiple PHP versions at the same time in WHM?
Yes — that’s one of the core features of EasyApache 4. You can install PHP 7.4, 8.1, 8.2, and 8.3 all on the same server and assign different versions to different accounts or even different directories within the same account. Use MultiPHP Manager in WHM to control which version each account runs.
How do I change PHP settings for just one cPanel account without affecting everyone else?
Open MultiPHP INI Editor in WHM and switch from the server-level view to the account-level view by selecting the specific account from the dropdown. Changes made there write to that account’s own php.ini and only affect that account. Individual cPanel users can also do this from their own cPanel if you’ve granted them permission.
What's the difference between PHP-FPM and DSO/CGI in EasyApache?
PHP-FPM (FastCGI Process Manager) runs PHP as a separate process pool per account, which improves performance and isolation — it’s the recommended handler for most setups. DSO runs PHP as an Apache module and is faster in some benchmarks but less secure on shared hosting. CGI is older and slower. If you’re unsure, PHP-FPM is the right default choice for any modern hosting environment.
Why does my PHP version change revert after a cPanel update?
It usually doesn’t — MultiPHP Manager settings persist across cPanel updates. But EasyApache profiles can sometimes be reset if someone runs a manual EA4 provision that overwrites the active profile. Make sure your PHP version selections are saved in a named EA4 profile so they’re not lost. You can save profiles in the EasyApache 4 interface under the Profiles section.
How do I check what PHP version a specific website is actually using?
The most reliable method is to create a temporary phpinfo() file in the site’s document root, load it in a browser, and look for the PHP Version line at the top — then delete the file immediately. From the command line, you can also check the account’s active handler by running php -i | grep 'Loaded Configuration File' using the account’s assigned PHP binary under /opt/cpanel/ea-phpXX/root/usr/bin/php.