Overview
Your hosting account runs PHP to execute server-side code for your website. The cPanel PHP version your site uses directly affects whether your CMS, plugins, themes, and custom scripts work correctly. PHP 7.4, for example, handles certain functions differently than PHP 8.1 or 8.2, and running the wrong version is one of the fastest ways to break a site after an update.
Most users land here after updating WordPress or a plugin and suddenly seeing a white screen, a 500 error, or a message like “Your server is running PHP version X but this plugin requires at least PHP Y.” Switching versions in cPanel takes about two minutes once you know where to look.
Depending on your hosting setup, you’ll use one of two tools: PHP Selector (available on CloudLinux-based shared hosting, which is what most Shared Hosting plans use) or MultiPHP Manager (available on WHM-managed servers). This article covers both.
Prerequisites
- Active cPanel account with login access
- Your hosting account must be on a plan that supports multiple PHP versions — most shared hosting plans do, but check with support if you’re unsure
- Know which PHP version your application requires (check your CMS documentation or plugin requirements)
- If you’re on a VPS or dedicated server, WHM access may be needed to enable MultiPHP for individual accounts
- A backup of your site before switching versions — especially if you’re moving from PHP 7.x to 8.x
Method 1: Using PHP Selector (CloudLinux Shared Hosting)
PHP Selector is the tool you’ll see on most shared hosting environments. It lets you set a PHP version per account, and in some configurations, per directory using an .htaccess rule or a php.ini override.
-
Log in to cPanel. Your login URL is typically
yourdomain.com/cpanelor the URL your host provided in your welcome email. - Find the Software section. Scroll down to the section labelled Software and click Select PHP Version. If you don’t see this, your host may not have CloudLinux installed — skip to Method 2.
-
Choose your PHP version. A dropdown at the top of the page shows your current version. Click it and select the version you need. As of 2026, PHP 8.1 and 8.2 are the most widely supported stable releases. PHP 8.3 is available on most updated environments.
📝 Note: PHP 7.4 reached end-of-life in November 2022. It may still appear in the selector, but it no longer receives security patches. Don’t use it for anything public-facing unless you have a specific, temporary reason.
- Click Set as current. This applies the change account-wide.
-
Review PHP extensions. After switching versions, PHP Selector shows a list of available extensions for that version. Extensions enabled on PHP 7.4 may not auto-enable on 8.1. Scroll through and re-enable anything your application needs — common ones include
mysqli,curl,mbstring,gd, andzip.⚠ Warning: This is the step most people skip. If your site works but images stop loading or contact forms break after a PHP switch, missing extensions are almost always the cause.
- Save your extension changes by clicking Save at the bottom of the extensions list.
- Test your site. Open your site in a browser and click through a few pages. Check your admin panel if applicable.
Method 2: Using MultiPHP Manager (WHM / VPS / Dedicated)
MultiPHP Manager is available in WHM and gives server admins more granular control. If you manage a VPS or dedicated server at Host & Tech, this is where you’ll handle PHP versioning at the account level.
-
Log in to WHM at
yourdomain.com:2087or via the server management panel. - Search for MultiPHP Manager in the WHM search bar. Click it when it appears.
- Find the account or domain you want to change. You can filter by domain name in the search field.
-
Select the PHP version from the dropdown next to the account and click Apply.
📝 Note: Changes here override any PHP version set at the cPanel level for that account. If a user is confused about why their PHP Selector change isn’t sticking, this is usually why — an admin-level MultiPHP setting is taking precedence.
- Install additional PHP versions if the one you need isn’t listed. Go to WHM > MultiPHP Installer, select the version, and install it. This takes a few minutes.
Method 3: Set PHP Version Per Directory Using .htaccess
Sometimes you need a different PHP version for one subdirectory — say, a legacy app in /old-app/ while the rest of the site runs PHP 8.2. You can do this with an .htaccess directive, but only if your server supports it (CloudLinux + PHP Selector environments typically do).
Add this to the .htaccess file inside the specific directory:
# Set PHP 7.4 for this directory only
AddHandler application/x-httpd-php74 .php
The handler name format varies by host. Common examples: x-httpd-php81, x-httpd-php82. If you’re not sure what handlers are available on your Host & Tech account, open a support ticket and we’ll confirm the exact strings for your server configuration.
Alternatively, on servers using PHP-FPM, you can specify the version in a php.ini file placed in the target directory:
; /public_html/old-app/php.ini
; This file won't work on all environments — confirm with your host
extension=mysqli
extension=curl
⚠ Warning: Dropping a php.ini file into a directory doesn’t automatically switch the PHP version — it only adjusts settings for the already-selected version. Don’t confuse the two.
Common Issues & Troubleshooting
Site shows a white screen or 500 error after switching PHP version
This almost always means a plugin, theme, or custom code uses a function that was deprecated or removed in the new version. PHP 8.0+ removed several functions that were deprecated back in PHP 7.x (e.g., create_function(), various MySQL functions). Check your error logs first:
tail -n 50 /home/yourusername/logs/yourdomain.com.error.log
The error message will usually name the file and line number causing the crash. If you need to roll back quickly, go back into PHP Selector and switch to the previous version — your site will come back up immediately.
PHP version change doesn’t seem to take effect
Check two things. First, a WHM-level MultiPHP setting may be overriding your cPanel selection (see Method 2 above). Second, if you have a php.ini or .user.ini file in your document root, it might be caching the old version setting. You can verify the active PHP version by creating a temporary info file:
<?php phpinfo(); ?>
Upload it as info.php to your public_html, visit yourdomain.com/info.php, and look for the PHP Version line at the top. Delete the file immediately after — leaving a phpinfo() file publicly accessible is a security risk.
PHP Selector is missing from cPanel
PHP Selector requires CloudLinux OS on the server. If your shared hosting plan doesn’t show this option, the server may be running a standard CentOS or AlmaLinux setup without CloudLinux, or your host hasn’t enabled the Selector feature for your account tier. Contact support to confirm. If you’re on a VPS, you have MultiPHP Manager in WHM instead.
Required PHP extension isn’t available after switching versions
Not every extension is compiled for every PHP version. If you switch to PHP 8.3 and a needed extension like imagick or ioncube isn’t in the list, it may not be installed on the server for that version. On shared hosting you’ll need to request installation. On a VPS or dedicated server, you can install it yourself:
# Example: install PHP 8.3 imagick extension on AlmaLinux/cPanel server
yum install ea-php83-php-pecl-imagick
# Then restart PHP-FPM if in use
systemctl restart ea-php83-php-fpm
WordPress says it requires a higher PHP version even after switching
WordPress reads the PHP version at runtime, but some caching layers (object cache, page cache, OPcache) can serve stale responses. Clear all caching layers after switching: clear your WordPress cache plugin, then flush OPcache. In WP-CLI:
wp cache flush
wp eval 'opcache_reset();'
If the warning persists, log out and back into WordPress admin to force a fresh session.
FAQ
Frequently Asked Questions
Which PHP version should I use for WordPress in 2026?
PHP 8.2 is the current recommended version for WordPress as of 2026. It’s well-supported by most major plugins and themes, and offers meaningful performance improvements over 8.1. PHP 8.3 works too, but extension compatibility is still catching up — I’d test on a staging environment before switching a production site to 8.3.
Will changing PHP version break my site?
It can, especially if you’re jumping from PHP 7.x to 8.x. PHP 8 removed a number of deprecated functions that older plugins or themes might still use. Always take a backup before switching, and check your error logs immediately after. If something breaks, you can roll back to the previous version in under a minute from PHP Selector.
Can I set a different PHP version for a subdomain or subfolder?
Yes, using an .htaccess handler directive in that specific directory (see Method 3 above). This only works on CloudLinux environments with PHP Selector enabled. On PHP-FPM setups without that support, you’d need a separate cPanel account or a server-level configuration change, which typically requires a support request.
Does changing PHP version affect my email or databases?
No. PHP version only affects how your web application code executes. Your email accounts, MySQL databases, and DNS settings are completely separate and won’t be touched by a PHP version change.
Why doesn't my phpinfo() show the version I selected?
The most common reason is a WHM-level MultiPHP override that’s taking precedence over your cPanel setting. If you’re on shared hosting and it’s still wrong, contact your host — there may be a server-level default that’s locked. Also confirm you saved the change in PHP Selector and didn’t just view the dropdown without applying it.