Running Multiple PHP Versions on a cPanel Server with MultiPHP Manager
Use cPanel’s MultiPHP Manager to run different PHP versions per domain—keep legacy sites on old PHP while upgrading the rest of your server. Follow this step‑by‑step guide, see the trade‑offs, and learn how to verify the setup.
26 Sept 2026, 20:36 UTC

Legacy Site, New Site, Same Server: The Real Problem
On a shared VPS or a small hosting environment you often see two conflicting demands:
- Legacy sites that still require PHP 5.6 or 7.0 to run their custom code.
- Newer applications that need PHP 8.1 or 8.2 for security and performance.
Upgrading the entire server to a newer PHP release would break the legacy site, while keeping the old version server‑wide keeps the whole stack exposed to unpatched vulnerabilities. The solution that cPanel offers out of the box is the MultiPHP Manager, part of EasyApache 4 (EA4). It lets you install several PHP branches side‑by‑side and assign each domain its own handler and version.
Why MultiPHP Manager Works
EA4 is an RPM‑based build system that compiles Apache, PHP, and their modules into a single, cohesive stack. When you install an additional PHP branch, EA4 creates a dedicated /opt/cpanel/ea-phpXX/root tree for that version. The MultiPHP Manager then writes per‑domain configuration into /usr/local/apache/conf/php-fpm.conf (or the old php.conf if you stick with mod_php). Each domain gets its own php-fpm pool or mod_php context, so the versions do not interfere.
Key benefits:
- Isolation – A broken or vulnerable site cannot downgrade the PHP runtime for the whole server.
- Fine‑grained tuning – PHP‑FPM pools can have custom memory limits, child counts, and log paths.
- Zero downtime – Switching a domain’s PHP version is a simple UI action; the web server reloads the pool configuration automatically.
Step‑by‑Step Worked Example
Assume the server currently runs PHP 7.4 (EA4 default) and you need to keep legacy.example.com on PHP 5.6 while all other sites can move to PHP 8.1.
- Install PHP 5.6 and 8.1 via EA4
# In WHM, navigate to EasyApache 4 → Customise → PHP Versions # Select "PHP 5.6" and "PHP 8.1" and click "Provision". # This may take a few minutes and will create /opt/cpanel/ea-php56 and /opt/cpanel/ea-php81. - Enable PHP‑FPM for the account
# In WHM, go to MultiPHP Manager → Accounts # Find legacy.example.com and click the toggle next to "PHP‑FPM". # The UI will create a pool named "legacy.example.com". - Assign PHP versions per domain
# In MultiPHP Manager → Domains # For legacy.example.com set "Handler" to "PHP‑FPM" and "PHP Version" to "5.6" # For all other domains, set "Handler" to "PHP‑FPM" and "PHP Version" to "8.1" # Click "Save". - Verify the assignment
# Create a file /home/legacy/public_html/info.php # # Browse to https://legacy.example.com/info.php # Look for "PHP Version: 5.6.x" and "Server API: FPM/FastCGI".
After the reload, legacy.example.com will run under its own FPM pool using PHP 5.6, while the rest of the server uses PHP 8.1.
Trade‑offs and Limitations
- Security risk of old PHP – PHP 5.6 is end‑of‑life. Keep the legacy code updated or plan a migration; MultiPHP Manager is a bridge, not a cure.
- Resource contention – Each PHP‑FPM pool consumes memory. On a low‑budget VPS, running many pools can exhaust RAM. Use the
pm.max_childrensetting in the pool’sphp.inivia the MultiPHP INI Editor. - Handler compatibility – Some PHP extensions (e.g.,
pdo_mysql) may not build for older branches. Verify that the required extensions are enabled in EA4 before assigning the version. - UI drift – The exact labels “PHP‑FPM” or “mod_php” can change between cPanel/WHM releases. Check the current UI if steps differ.
- Automatic updates – When you run an EA4 update, the tool may reinstall the PHP branches. Custom
php.inichanges should be made via the MultiPHP INI Editor or in/opt/cpanel/ea-phpXX/root/etc/php-fpm.d/include files; otherwise they can be overwritten.
Practical Checklist Before Switching
- Back up the domain’s files and database.
- Test the PHP version change on a staging clone of the domain.
- Check the site’s error log after the switch for fatal errors (e.g., missing extensions).
- Monitor the PHP‑FPM pool logs (
/var/log/php-fpm/*) for memory or timeout warnings. - Verify that custom
php.inivalues persist after an EA4 update by re‑checkingphpinfo().
Actionable Takeaway
When you face a legacy site that blocks a server‑wide PHP upgrade, use cPanel’s MultiPHP Manager to keep that site on its required PHP branch while upgrading the rest of your stack. Remember to:
- Install all necessary PHP branches via EasyApache 4.
- Enable PHP‑FPM per account for isolation.
- Assign versions carefully and verify with
phpinfo(). - Plan a migration for end‑of‑life PHP as soon as possible.
With these steps, you can maintain compatibility without compromising security or performance across your hosting environment.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.