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:
- Log into cPanel
- Search for MultiPHP Manager
- 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.jsonor vendor documentation
Look for deprecated functions or incompatible extensions. The PHP manual maintains migration guides between major versions.
Change PHP Version Per Domain
- In cPanel, open MultiPHP Manager
- Check the boxes next to domains you want to update
- Select the target PHP version from the dropdown
- 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:
- Open MultiPHP Manager
- Look for the system default dropdown at the top
- Select your preferred version
- 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:
- Open MultiPHP INI Editor in cPanel
- Choose Editor Mode (preferred) or Basic Mode
- Select the domain from the dropdown at the top
Basic Mode exposes these common directives:
memory_limit: Maximum memory a script can allocatemax_execution_time: Script timeout in secondspost_max_size: Maximum POST request sizeupload_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 filepost_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:
- Check current limits:
phpinfo()or MultiPHP INI Editor - Increase all three related limits:
-
upload_max_filesize = 128M-post_max_size = 128M-memory_limit = 256M - Clear WordPress cache if using a caching plugin
- 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:
- Increase
max_execution_timeto 600 (10 minutes) or higher - For very large imports, use WP-CLI or SSH instead of web-based tools
- Consider splitting large SQL files into smaller chunks
- Verify MySQL
max_allowed_packetisn'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:
- Check error logs in cPanel > Errors
- Common issues:
-
mysql_*functions removed in PHP 7.0+: rewrite to usemysqlior PDO -mcryptextension removed in PHP 7.2+: migrate toopensslorsodium- Deprecated ereg functions: replace with PCRE equivalents - If immediate fixes aren't possible, revert to the older PHP version temporarily
- 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.inicache: 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
- Check error logs immediately: cPanel > Errors or
/home/username/public_html/error_log - Common causes:
- Missing PHP extensions (Imagick, ZIP, GD)
- Syntax errors in
.user.iniorphp.inioverrides - Incompatible application code - Revert to the previous PHP version
- Fix the underlying issue
- 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_limitto 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.iniand 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.
