Skip to content
Back to Blog
Hosting Support8 min read

Managing PHP Versions and Limits in cPanel with MultiPHP

Learn how to safely switch PHP versions per domain using cPanel's MultiPHP Manager and adjust memory_limit, max_execution_time, and upload limits without breaking production sites.

Written by Abdul AbrorTechnical Hosting Support Engineer
Managing PHP Versions and Limits in cPanel with MultiPHP
On this page

Modern web applications often require different PHP versions and configurations. A WordPress site might need PHP 8.1 while a legacy billing system still depends on PHP 7.4. cPanel's MultiPHP system lets you run multiple PHP versions simultaneously and tune limits on a per-domain basis—without touching the server's global configuration or restarting Apache.

Understanding MultiPHP Architecture

MultiPHP replaced the older single-PHP model in cPanel & WHM. Instead of forcing every account to use the same PHP version, MultiPHP lets you assign different handlers and versions to individual domains or the entire account.

The system uses PHP-FPM (FastCGI Process Manager) by default on modern cPanel servers. PHP-FPM runs as isolated pools per user, improving security and stability. Each domain can have its own PHP version without affecting others on the same account.

WHM administrators set which PHP versions are available system-wide. Account owners then choose from that list using MultiPHP Manager in cPanel.

Switching PHP Versions Safely

Check Current PHP Version

Before making changes, confirm what your site currently runs. Create a file named info.php in your document root:

<?php
phpinfo();

Access it via https://yourdomain.com/info.php and note the PHP version at the top. Delete this file after checking—it exposes configuration details you don't want public.

Alternatively, check the current version in cPanel:

  1. Log into cPanel
  2. Search for MultiPHP Manager
  3. The current version appears next to each domain

Verify Application Compatibility

Check your application's documentation for PHP version requirements:

  • WordPress: Recent versions require PHP 7.4 minimum; 8.0+ recommended
  • Magento 2: Version-specific requirements; check release notes
  • Laravel: Version 10 requires PHP 8.1+
  • Custom applications: Review composer.json or vendor documentation

Look for deprecated functions or incompatible extensions. The PHP manual maintains migration guides between major versions.

Change PHP Version Per Domain

  1. In cPanel, open MultiPHP Manager
  2. Check the boxes next to domains you want to update
  3. Select the target PHP version from the dropdown
  4. Click Apply

Changes take effect immediately. No Apache restart required with PHP-FPM.

Pro tip: Never bulk-update all domains without testing. Update a staging subdomain first, test thoroughly, then move to production.

Set Account-Wide Default

The account-wide default applies to new domains and any domain not explicitly assigned a version:

  1. Open MultiPHP Manager
  2. Look for the system default dropdown at the top
  3. Select your preferred version
  4. Click Apply

Existing domain assignments remain unchanged—only new domains inherit this default.

Adjusting PHP Limits and Directives

cPanel provides two interfaces for modifying PHP settings: MultiPHP INI Editor and .htaccess overrides.

Using MultiPHP INI Editor

The MultiPHP INI Editor offers a safe, GUI-based way to adjust common limits:

  1. Open MultiPHP INI Editor in cPanel
  2. Choose Editor Mode (preferred) or Basic Mode
  3. Select the domain from the dropdown at the top

Basic Mode exposes these common directives:

  • memory_limit: Maximum memory a script can allocate
  • max_execution_time: Script timeout in seconds
  • post_max_size: Maximum POST request size
  • upload_max_filesize: Individual file upload limit

Adjust values and click Apply. Changes write to a local php.ini or .user.ini file in your home directory, depending on the PHP handler.

Editor Mode shows the full INI syntax:

memory_limit = 256M
max_execution_time = 300
post_max_size = 64M
upload_max_filesize = 64M
max_input_vars = 3000

This mode lets you set any directive PHP allows users to modify. Not all directives are changeable—some require WHM-level access.

Important Limit Relationships

Three upload-related directives must follow a logical order:

upload_max_filesize <= post_max_size <= memory_limit
  • upload_max_filesize: Size of a single uploaded file
  • post_max_size: Total size of the entire POST request (all files combined)
  • memory_limit: Total memory available to the PHP script

If you set upload_max_filesize = 128M but post_max_size = 64M, uploads larger than 64M fail silently. Always verify these values align with your requirements.

Per-Directory Overrides with .htaccess

For PHP running as an Apache module (less common with modern cPanel), you can set directives in .htaccess:

php_value memory_limit 256M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300

With PHP-FPM, .htaccess PHP directives are ignored. Use .user.ini instead:

memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

Place .user.ini in the directory where you need custom settings. PHP-FPM reads this file with a cache TTL—changes may take a few minutes to apply.

Common Scenarios and Solutions

Scenario 1: WordPress Media Uploads Failing

Symptom: Large images or plugin uploads fail with no clear error.

Solution:

  1. Check current limits: phpinfo() or MultiPHP INI Editor
  2. Increase all three related limits: - upload_max_filesize = 128M - post_max_size = 128M - memory_limit = 256M
  3. Clear WordPress cache if using a caching plugin
  4. Test with a large file

If uploads still fail, check disk quota and server-side security modules like ModSecurity.

Scenario 2: Script Timeout During Imports

Symptom: Database imports or migrations time out halfway through.

Solution:

  1. Increase max_execution_time to 600 (10 minutes) or higher
  2. For very large imports, use WP-CLI or SSH instead of web-based tools
  3. Consider splitting large SQL files into smaller chunks
  4. Verify MySQL max_allowed_packet isn't also a bottleneck

Scenario 3: Legacy App Won't Run on New PHP

Symptom: After upgrading PHP, errors about deprecated functions or missing extensions appear.

Solution:

  1. Check error logs in cPanel > Errors
  2. Common issues: - mysql_* functions removed in PHP 7.0+: rewrite to use mysqli or PDO - mcrypt extension removed in PHP 7.2+: migrate to openssl or sodium - Deprecated ereg functions: replace with PCRE equivalents
  3. If immediate fixes aren't possible, revert to the older PHP version temporarily
  4. Schedule time to refactor or update the application

Scenario 4: One Domain Needs Different Limits

You host multiple sites on one cPanel account. A single site needs higher memory, but you don't want to raise limits globally.

Solution:

PHP limits in MultiPHP INI Editor apply account-wide with PHP-FPM. For truly per-domain limits, you need WHM-level PHP-FPM pool customization, which requires root access or a system administrator.

Workaround: Place a .user.ini file in that domain's document root with higher values. PHP-FPM respects local .user.ini files within the limits the administrator configured.

Troubleshooting MultiPHP Changes

Changes Not Taking Effect

Check cache layers:

  • OPcache: PHP caches compiled scripts. Restart PHP-FPM via WHM or wait for the cache to expire
  • .user.ini cache: PHP-FPM caches these files for a defined interval (typically 5 minutes)
  • Application cache: Clear WordPress, Magento, or application-level caches
  • Browser cache: Hard refresh or test in an incognito window

Verify file permissions: .user.ini and custom php.ini files must be readable by the PHP process. Incorrect ownership or permissions cause PHP to ignore them.

White Screen or 500 Errors After Changing PHP Version

  1. Check error logs immediately: cPanel > Errors or /home/username/public_html/error_log
  2. Common causes: - Missing PHP extensions (Imagick, ZIP, GD) - Syntax errors in .user.ini or php.ini overrides - Incompatible application code
  3. Revert to the previous PHP version
  4. Fix the underlying issue
  5. Test on a staging subdomain before re-applying

Which PHP Handler Am I Using?

Run phpinfo() and look for Server API:

  • FPM/FastCGI: PHP-FPM (modern default)
  • CGI/FastCGI: suPHP or FastCGI (older)
  • Apache 2.0 Handler: mod_php (rare on shared hosting)

The handler determines which configuration method works. PHP-FPM uses .user.ini; mod_php uses .htaccess.

Security Considerations

Disable Dangerous Functions

Some PHP functions pose security risks in shared environments. System administrators typically disable them via disable_functions, but verify your configuration:

disable_functions = exec,passthru,shell_exec,system,proc_open,popen

You cannot override this setting from cPanel if the administrator set it globally. If your application legitimately requires a disabled function, contact your host.

Keep PHP Updated

Older PHP versions stop receiving security patches. The PHP project maintains each major version for approximately three years:

  • Active support: 2 years (bug fixes and security patches)
  • Security-only support: 1 additional year
  • End of life: no updates at all

Schedule regular PHP upgrades as part of your maintenance routine. Test on staging, update production, monitor for issues.

Monitor Resource Usage

Higher memory limits allow scripts to consume more resources. Balance flexibility with stability:

  • Don't blindly raise memory_limit to 512M or 1G without understanding why scripts need it
  • Use application profiling tools (Xdebug, New Relic) to identify memory leaks
  • Set limits based on actual requirements, not arbitrary high values

Excessive resource usage can trigger account suspensions on shared hosting.

Best Practices Checklist

  • Test version changes on staging first: Never upgrade PHP directly in production
  • Document your settings: Keep notes on custom limits and why you set them
  • Review error logs after changes: Catch issues immediately
  • Set calendar reminders: Check for PHP updates quarterly
  • Align all upload limits: Ensure upload_max_filesize <= post_max_size <= memory_limit
  • Delete phpinfo() files: They expose sensitive configuration data
  • Use version control: Track changes to .user.ini and custom configs
  • Communicate with your host: If you need extensions or higher limits, ask—many hosts accommodate reasonable requests

Conclusion

MultiPHP gives you precise control over PHP versions and resource limits without needing root access or command-line expertise. By switching versions per domain, you can modernize applications incrementally, run legacy systems alongside new projects, and tune performance on a case-by-case basis.

Always test changes in staging, monitor error logs closely, and keep PHP versions current to maintain security and compatibility. With these tools and techniques, you can manage PHP configurations confidently across all your cPanel-hosted domains.

FAQ

Can I run different PHP versions on different subdomains?

Yes. MultiPHP treats each subdomain as a separate domain in the interface. Select it individually and assign the desired PHP version.

Will changing PHP versions break my email?

No. Email services (IMAP, SMTP, POP3) run independently of PHP. Web-based email clients like Roundcube or Horde may have their own PHP requirements, but they're separate from your site's PHP version.

How do I know which PHP version my application supports?

Check the application's official documentation or release notes. For WordPress plugins and themes, review the readme or plugin header. For Composer-based projects, inspect composer.json for the PHP version constraint.

Can I install PHP extensions myself in cPanel?

Not directly. PHP extensions require compilation and system-level installation. Contact your hosting provider or use WHM if you have root access. Most hosts pre-install common extensions like GD, cURL, and Mbstring.

Why does my site still show the old PHP version after I changed it?

Check OPcache and application-level caches first. If using CloudFlare or another CDN, bypass the proxy and test directly against your server's IP. Verify you changed the correct domain—MultiPHP requires explicit selection.