cPanel & WHM

Optimise PHP on cPanel: MultiPHP Manager, MultiPHP INI Editor, PHP-FPM and PHP Selector

Learn how to enhance PHP performance in cPanel using MultiPHP Manager and CloudLinux PHP Selector for maximum speed and stability.

Short answer: Use the newest PHP version your site supports (MultiPHP Manager, or Select PHP Version on CloudLinux), make sure OPcache is on, and set sensible limits in MultiPHP INI Editor: memory_limit 256M to 512M, upload limits that fit your content, and max_execution_time only as high as needed. On servers you manage, tune PHP-FPM’s process limits per domain. Measure before and after each change.

MultiPHP Manager or PHP Selector?

Tool Where What it does
MultiPHP Manager cPanel and WHM, Software section Sets the PHP version for each domain, from the versions installed with EasyApache 4. Root can also set PHP-FPM options here.
MultiPHP INI Editor cPanel and WHM, Software section Changes php.ini settings per domain (cPanel) or per PHP version (WHM).
Select PHP Version (PHP Selector) cPanel on CloudLinux servers Picks a CloudLinux alt-php version, its extensions and options for the whole account.

On CloudLinux servers both may appear. PHP Selector applies when the domain uses the server’s default (inherited) version in MultiPHP Manager. If a domain has its own version set in MultiPHP Manager, that setting wins. When in doubt, ask support which one your account uses.

Step 1: use a current PHP version

  1. In cPanel, open Software > MultiPHP Manager (or Select PHP Version on CloudLinux).
  2. Tick the domain, choose the newest version your CMS and plugins support, and click Apply.
  3. Open the site and its admin area, and check the error log for warnings.

Newer versions are faster and still get security fixes. See our PHP version support guide for current dates.

Step 2: set the right limits

Open Software > MultiPHP INI Editor, choose Basic Mode and the domain:

Setting Typical value Notes
memory_limit 256M (512M for stores) Too low causes “Allowed memory size exhausted” errors; too high hides memory leaks.
max_execution_time 60 to 120 Long-running jobs belong in cron, not web requests.
upload_max_filesize What your largest upload needs Keep post_max_size a little larger.
max_input_vars 3000 or more for large forms and menus Too low silently drops form fields.

Step 3: make sure OPcache is on

OPcache keeps compiled PHP code in memory, so it is not compiled on every request. It is usually on by default. Check that opcache.enable is On in a phpinfo() page, or that the opcache extension is ticked in Select PHP Version on CloudLinux. On servers you manage, give it enough memory:

; WHM > MultiPHP INI Editor > Editor Mode, for each PHP version
opcache.enable=1
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.revalidate_freq=60

Step 4: tune PHP-FPM (server administrators)

PHP-FPM runs a pool of PHP processes for each domain. In WHM, open MultiPHP Manager, choose System PHP-FPM settings for defaults or a domain’s PHP-FPM settings for one site:

Setting Meaning
Max Children The most PHP processes the site can run at once. Limits memory use.
Process Idle Timeout How long an idle process waits before it exits.
Max Requests Requests a process serves before it restarts, which limits slow memory growth.

Size Max Children from the memory available and the average size of a PHP process. A busy store may need 10 to 20; a small blog needs only a few. If the PHP-FPM error log says the pool reached max_children, raise it carefully or add caching so fewer requests reach PHP.

Step 5: check the result

<?php phpinfo();   // save as info.php, open it in the browser, then delete the file

Confirm the PHP version, OPcache status and your limits. Then measure page speed again and compare with your notes.

Other big wins

  • Page caching, so most visitors never run PHP at all.
  • An object cache such as Redis for dynamic sites. See our Redis Manager guide.
  • Removing slow plugins and extensions.

Need help with this?

Want PHP tuned for your sites? Our team can configure versions, OPcache and PHP-FPM on your server.

See server management plansContact @CustomerPanel

Frequently asked questions

How do I change the PHP version in cPanel?

Open MultiPHP Manager, tick the domain, choose the version and click Apply. On CloudLinux, use Select PHP Version.

Why does my PHP Selector change not apply?

The domain probably has its own version in MultiPHP Manager. Set it to inherit the default, or ask support.

How do I raise memory_limit?

In MultiPHP INI Editor, choose the domain and change memory_limit, or use the Options tab in Select PHP Version.

Is OPcache enabled by default?

Usually yes. Check opcache.enable in a phpinfo page to be sure.

What is PHP-FPM Max Children?

The highest number of PHP processes a site can run at once. Set it to fit the server’s memory.


Sources