UnderHost
Knowledgebase Docs

How to change PHP version in CloudPanel

Switch PHP versions per site in CloudPanel, adjust php.ini settings, and manage PHP-FPM pool configuration.

On this page

CloudPanel assigns a PHP version to each site independently. Each site runs its own PHP-FPM pool-meaning different sites can run different PHP versions simultaneously on the same server with full isolation.

Change PHP version

  1. Open site settings

    Log in to CloudPanel, go to Sites, and click the site you want to modify.

  2. Go to PHP Settings

    Click the PHP tab (or PHP Settings depending on your CloudPanel version).

  3. Select the new PHP version

    Choose the desired PHP version from the dropdown. Available versions depend on what is installed on the server.

  4. Save

    Click Save. CloudPanel updates the Nginx configuration and PHP-FPM pool for this site immediately.

Test after changing PHP version

After switching PHP versions, reload your site and check for errors. A PHP version upgrade may reveal deprecation warnings or compatibility issues with older plugins or code. Check the error logs if the site breaks after a version change.

Adjust PHP settings

Common PHP settings are adjustable directly from the PHP tab in CloudPanel:

SettingDescriptionTypical value for WordPress
memory_limitMaximum RAM per PHP process256M
upload_max_filesizeMaximum single file upload size64M or 128M
post_max_sizeMaximum POST request size (must be ≥ upload_max_filesize)64M or 128M
max_execution_timeMaximum seconds a PHP script can run120
max_input_varsMaximum number of input variables per request5000 for complex forms

Edit these values in the PHP settings form and click Save. Changes apply immediately-no server restart needed.

PHP-FPM settings

CloudPanel creates a dedicated PHP-FPM pool per site. Advanced FPM settings (such as pm.max_children and pm.max_requests) control how many simultaneous PHP processes the site can run. The defaults are suitable for most sites.

If your site has very high concurrent traffic and PHP processes are queuing up, increase pm.max_children. Be cautious-each PHP-FPM child process consumes RAM, and too many children can exhaust the VPS memory.

Check available RAM before increasing FPM workers

Each PHP-FPM worker typically uses 32–128 MB of RAM depending on the application. On a 2 GB VPS running multiple sites, setting pm.max_children too high across all sites can cause out-of-memory conditions. Monitor RAM usage before and after changes.

Verify the active PHP version

Create a temporary file at /home/SYSTEM_USER/htdocs/yourdomain.com/phpinfo.php via SFTP:

<?php phpinfo(); ?>

Open https://yourdomain.com/phpinfo.php in a browser to see the active PHP version and loaded extensions. Delete the file immediately after checking.

Multiple sites, multiple PHP versions

One of CloudPanel's strengths is that each site runs its own PHP-FPM pool with its own PHP version. You can run:

  • A WordPress 6.x site on PHP 8.2
  • A legacy application on PHP 7.4
  • A new Laravel project on PHP 8.3

All simultaneously on the same server without conflict. Change each site's PHP version independently from its settings page.

Related: How to create a website in CloudPanel | How to manage vHost settings in CloudPanel | How to install WordPress on UnderHost | CloudPanel troubleshooting-common issues and fixes

Was this article helpful?

Need CloudPanel on a server?

Use CloudPanel on an UnderHost VPS or dedicated server for fast PHP app and WordPress hosting without a heavy panel stack.

Related articles

Back to CloudPanel