Glossary

How to Change PHP Version in cPanel Without Breaking Your Site

Learn how to change the PHP version in cPanel using MultiPHP Manager, step by step, without taking your site offline.

A teenager in a hoodie studying with books and notes on a table, focused on learning indoors.

To change the PHP version in cPanel, go to Software → MultiPHP Manager, select your domain, choose the desired PHP version from the dropdown menu, and click Apply. The change takes effect immediately and requires no server restart.

That said, switching PHP versions without checking compatibility can cause fatal errors. This guide walks you through how to do it safely, what precautions to take beforehand, and how to roll back instantly if something breaks.

Why Would You Need to Change the PHP Version?

PHP is an actively maintained language with significant version jumps. Each major release brings performance gains, security patches, and new features — but can also remove deprecated functions your site still relies on.

The most common reasons to change your PHP version include:

  • Updating WordPress, Joomla, or Drupal — modern CMS platforms require PHP 8.0 or higher.
  • Fixing compatibility errors — a plugin or theme may fail on the default server version.
  • Security — PHP 7.3 and earlier no longer receive security patches.
  • Performance — PHP 8.x consistently outperforms PHP 7.x in real-world benchmarks.

Before You Change: Pre-Flight Checklist

A PHP version upgrade can break functionality if your code uses removed or deprecated functions. Complete these steps before making any changes:

  1. Create a full backup — use cPanel's Backup Wizard to download a backup of both files and databases.
  2. Check your CMS or app requirements — WordPress publishes its minimum PHP version in its official documentation.
  3. Review installed plugins and themes — some legacy plugins are not compatible with PHP 8.x.
  4. Note your current PHP version — so you can roll back quickly if needed.

If you manage multiple sites, consider testing the new version on a staging environment or a lower-traffic domain first.

How to Change PHP Version Using MultiPHP Manager

cPanel includes MultiPHP Manager, a built-in tool that lets you assign a different PHP version to each domain or directory in your account. Here's how to use it:

  1. Log in to your cPanel (usually at yourdomain.com/cpanel or yourdomain.com:2083).
  2. Under the Software section, click MultiPHP Manager.
  3. You'll see a list of all your domains and subdomains. Check the box next to the domain you want to modify.
  4. From the PHP Version dropdown (top-right), select the version you need.
  5. Click Apply. The change takes effect immediately.

Don't see MultiPHP Manager? Some hosting providers label it PHP Selector (CloudLinux) or place it under Software → PHP Selector. If it's missing entirely, contact your hosting provider's support team.

Setting PHP for a Specific Directory via .htaccess

If you need a different PHP version for just one subdirectory — for example, a legacy application inside your main domain — you can set it through MultiPHP Manager → PHP Version by Directory, or add a line to your .htaccess file:

AddHandler application/x-httpd-php82 .php

Replace php82 with the identifier for your target version (php74, php80, php81, etc.). This method takes precedence over the domain-level setting.

How to Verify Which PHP Version Is Active

After applying the change, confirm the server is using the correct version before calling it done.

The simplest way is to create a temporary info.php file in your domain's root with this content:

<?php phpinfo(); ?>

Open it in your browser (yourdomain.com/info.php) and the active version will appear in the very first line. Delete this file immediately afterward — it exposes sensitive server configuration data.

Alternatively, MultiPHP Manager in cPanel displays the assigned version for each domain without needing to create any files.

What to Do If Your Site Breaks After the Change

If your site shows a 500 error, a blank screen, or deprecated-function warnings after the PHP upgrade, don't panic. Rolling back takes seconds:

  1. Return to MultiPHP Manager.
  2. Select the affected domain.
  3. Choose your previous PHP version from the dropdown and click Apply.

Your site should recover within seconds. If the problem persists, check the error log at cPanel → Error Logs to pinpoint the problematic function or plugin.

Common Error Likely Cause Fix
500 error / blank screen Function removed in PHP 8.x (e.g. mysql_*) Update the plugin/theme or revert to PHP 7.4
"Call to undefined function" PHP extension not enabled Enable the extension in MultiPHP INI Editor
Deprecated warnings Code uses obsolete functions Update code or suppress notices temporarily

Key Takeaways

  • MultiPHP Manager in cPanel lets you change the PHP version per domain or directory in seconds.
  • Always create a full backup before switching PHP versions.
  • Verify compatibility of your CMS, plugins, and themes with the target version.
  • Confirm the change with a temporary phpinfo() file — then delete it immediately.
  • Rolling back to a previous PHP version takes under a minute if something goes wrong.
  • PHP 7.3 and below are end-of-life — migrating to PHP 8.x is a security priority.

Looking for hosting that gives you full control over PHP versions for every project? elenlace.com offers hosting plans with complete MultiPHP support and real technical assistance. Check out our plans and get started today.

Explore more tutorials like this in our hosting glossary and how-to guides.

FAQ

Does changing the PHP version in cPanel affect all my domains?

Not necessarily. MultiPHP Manager allows you to assign independent PHP versions to each domain or subdomain within the same hosting account. You can run PHP 8.2 on one domain and PHP 7.4 on another simultaneously.

What PHP version should I use for WordPress in 2024?

WordPress recommends PHP 8.1 or higher. PHP 8.2 and 8.3 are stable and deliver better performance. Avoid versions below 8.0, as they are no longer receiving active security updates.

Can I change the PHP version without cPanel access?

Yes. With SSH access you can use php -v to check the current version and tools like update-alternatives (Linux) to switch versions. On shared hosting without SSH, you'll need to use cPanel or contact your hosting provider's support team.

Which PHP extensions should I enable after switching versions?

It depends on your application. WordPress typically needs: mbstring, curl, gd or imagick, zip, and mysqli. You can enable them from MultiPHP INI Editor in cPanel under the Extensions tab.

Prefer it done for you? El Enlace handles hosting and professional web development.

Useful resources

Other providers and guides worth comparing:

← All