How to Switch PHP Versions in cPanel: A Complete Step-by-Step Guide

Every website owner eventually runs into the PHP version question. That plugin you need requires PHP 8.1. Your CMS just emailed you about an end-of-life deprecation. Or maybe you installed a new application that simply won’t work on the default PHP version your host configured years ago. Whatever the reason, switching PHP versions is one of the most common — and most impactful — server-side changes you can make in cPanel. Do it right and your site gets faster, more secure, and stays compatible with modern software. Do it wrong and you’re staring at a white screen.

The good news is that cPanel gives you multiple ways to manage PHP versions, from simple dropdown menus in the control panel to granular per-directory rules via MultiPHP INI Editor. This guide walks through every method step by step, explains what’s happening under the hood, and covers the gotchas that trip up even experienced sysadmins.

Understanding How PHP Version Switching Works in cPanel

cPanel uses Apache’s mod_suphp, mod_php, or FastCGI (depending on the server configuration) to serve PHP files. When you change the PHP version through the cPanel interface, you’re actually modifying how Apache processes .php files for your account. The server may have multiple PHP versions compiled and ready — cPanel’s MultiPHP Manager simply tells Apache which binary to use.

Most modern cPanel servers use EasyApache 4 with MultiPHP, which supports PHP versions ranging from 7.4 (now end-of-life) through 8.x. Your hosting provider determines which versions are available on their servers, but the standard set usually includes 7.4, 8.0, 8.1, 8.2, and 8.3. Some forward-looking hosts already offer PHP 8.4.

Checking Your Current PHP Version in cPanel

Before making any changes, confirm what PHP version your site is currently running. You have several ways to check:

  • cPanel Stats Widget — On the cPanel dashboard, the “General Information” section often lists the current PHP version.
  • Info Script — Create a file called info.php in your document root with <?php phpinfo(); ?> and load it in your browser. Delete it afterward for security.
  • Server Status — In cPanel, navigate to “Software” → “MultiPHP Manager” to see your current version at a glance.

Knowing your starting version is critical because the jump from PHP 7.x to 8.x introduces several breaking changes. The mysql_* functions were removed entirely in PHP 7.0, and PHP 8.x deprecated or changed the behavior of many other core functions. A direct upgrade from 7.4 to 8.2 without testing is risky.

How to Change the PHP Version in cPanel Using MultiPHP Manager

MultiPHP Manager is the primary tool for changing PHP versions in cPanel. Here’s the process:

  1. Log in to your cPanel dashboard.
  2. Scroll to the “Software” section and click MultiPHP Manager.
  3. In the “System PHP Version” dropdown, you’ll see all available PHP versions.
  4. Select your desired version (e.g., PHP 8.2) and click Apply.
  5. Wait 30–60 seconds while cPanel updates the Apache configuration.
  6. Verify the change by refreshing the MultiPHP Manager page or running a phpinfo() check.

This approach changes the PHP version for your entire cPanel account — every domain, subdomain, and application on that account. If you host multiple sites under one account, this may not be ideal. For per-directory control, you’ll need the next method.

Switching PHP Versions per Directory or Domain

If you host multiple sites under a single cPanel account, changing the system-wide PHP version might break sites that aren’t compatible with the newer version. cPanel’s MultiPHP Manager lets you override the version for individual directories:

  1. Open MultiPHP Manager from the Software section.
  2. Scroll down to the Per-Directory PHP Version table.
  3. You’ll see a list of document roots for each addon domain, subdomain, or alias.
  4. Click the dropdown next to the directory you want to change.
  5. Select the PHP version for that specific directory and click Apply.

This creates a .htaccess-style handler override that tells Apache to use a specific PHP binary just for that directory. It’s the safest way to run modern PHP on one site while keeping legacy PHP on another — a common scenario during a site migration or when supporting multiple clients from one reseller account.

Using a .htaccess File to Override PHP Versions

For advanced users, you can also switch PHP versions by adding a line to your .htaccess file. This is useful if MultiPHP Manager isn’t available on your host or you need deployable configs:

# Switch to PHP 8.2 via CGI/FastCGI
AddHandler application/x-httpd-ea-php82 .php

# For mod_suphp-based servers:
suPHP_ConfigPath /home/username/public_html

The exact handler name varies by hosting provider. Common patterns include ea-php80, ea-php81, ea-php82, lsphp82, or cgi-php82. Check with your host if you’re unsure which handler syntax they use.

Testing Compatibility Before Switching PHP Versions

Blindly switching PHP versions is one of the fastest ways to take a production site offline. Follow these checks before you flip the switch:

  1. Create a staging copy — Use cPanel’s WordPress Toolkit staging feature or clone your site to a subdomain for testing.
  2. Check CMS requirements — WordPress 6.x recommends PHP 8.x. Joomla 5.x requires PHP 8.1+. Check your specific CMS version’s documentation.
  3. Audit plugin and theme compatibility — Run a PHP compatibility checker on your theme and active plugins. Many popular tools like PHP Compatibility Checker (WordPress plugin) flag deprecated function usage.
  4. Enable error logging — Before switching, enable PHP error display temporarily in your wp-config.php or equivalent CMS config file. After testing, disable it.
  5. Test core workflows — After switching the staging copy, test login, form submissions, search, media uploads, and any custom functionality.

Most CMS platforms handle PHP version changes gracefully within one minor version. A jump from PHP 8.0 to 8.1 rarely breaks anything. Going from 7.4 to 8.2, however, is a two-major-version leap and you should expect some deprecation notices at minimum.

Tuning PHP Settings After Switching Versions

Switching PHP versions often resets certain runtime values back to defaults. After making the switch, revisit these settings using cPanel’s MultiPHP INI Editor (also under the Software section):

  • memory_limit — WordPress recommends 64MB minimum. Set it to 128MB or 256MB for most modern setups.
  • upload_max_filesize — Default is often 2MB. Bump this to 32MB or 64MB if you handle media files.
  • post_max_size — Should match or exceed upload_max_filesize. Set to 64MB.
  • max_execution_time — Default 30 seconds. Increase to 120 or 300 if you run background imports or batch processing.
  • max_input_vars — The default of 1000 can cause data loss on large forms or plugins with many settings. Bump to 3000 or 5000.
  • opcache.enable — Ensure OpCache is enabled (usually on by default in PHP 8.x) and set opcache.memory_consumption to at least 128.

These values can be set system-wide in MultiPHP INI Editor or per-directory if you have different applications with different needs. Apply changes and test immediately — an overly restrictive memory_limit after a PHP version switch is a common cause of 500 errors.

Troubleshooting Common PHP Version Switch Issues

White Screen of Death (WSOD)

A completely blank page usually means a PHP fatal error that isn’t being displayed. Enable error display temporarily by adding this to your site’s config file:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);

For non-WordPress sites, add ini_set('display_errors', 1); error_reporting(E_ALL); to a test script. The error message will reveal the offending code — typically a deprecated function call or a removed extension.

Internal Server Error (500)

Check your .htaccess file for directives that reference specific PHP handlers. If you were using a custom handler pointing to ea-php74 and switched to PHP 8.x, the old handler will break. Update the AddHandler line to match your new PHP version.

“PHP Extension Not Found” Errors

Some PHP extensions aren’t automatically loaded under a new version. In MultiPHP INI Editor, check which extensions are enabled. Common extensions like imagick, ioncube, or SourceGuardian may need to be explicitly loaded for the new version by your hosting provider. Contact support if you see extension-related errors after switching.

Changes Not Taking Effect

If MultiPHP Manager shows the new version but phpinfo() still reports the old one, your site may be using a custom .user.ini file in the document root that overrides the system setting. Delete or rename the .user.ini file, then clear your browser and server caches.

Key Takeaways

  • Use cPanel’s MultiPHP Manager to switch the system-wide PHP version for an entire account, or per-directory overrides for individual domains and subdirectories.
  • Always test PHP version changes on a staging environment before applying them to a production site.
  • Jumping more than one major version (e.g., 7.4 → 8.2) significantly increases the risk of breaking changes and deprecated function errors.
  • After switching versions, revisit critical PHP settings in MultiPHP INI Editor — memory_limit, upload_max_filesize, and OpCache defaults don’t always carry over.
  • Use .htaccess handler overrides for deployable, per-directory PHP version control when the MultiPHP interface isn’t sufficient.
  • Monitor your site’s error logs for 24–48 hours after the switch to catch any intermittent compatibility issues.