cPanel PHP Version Not Changing? Which Setting Wins (MultiPHP, PHP Selector, .htaccess)
You set PHP 8.4 in cPanel and the site still runs 8.2. Often nothing is broken: several settings can decide the PHP version, and the one you changed may not be the one that wins. This post lays out the order in which those settings are applied, so you know which one to look at first. It uses documentation from cPanel and LiteSpeed. The rules differ between server setups, so the sections say which stack each rule comes from.
If you are just trying to change the version, start with how to change the PHP version in cPanel.
The settings that can decide the version
| Setting | Where it lives | Scope |
|---|---|---|
| System default PHP | Set by the server administrator (WHM) | Every account that inherits it |
| MultiPHP Manager version | cPanel, Software, MultiPHP Manager | One document root (domains that share a document root share its version) |
| PHP Selector version | cPanel, Select PHP Version (CloudLinux) | Account-wide according to cPanel’s documentation (the screen on some hosts also shows a Per Domain Settings tab; I have not verified what it controls) |
Handler line in .htaccess |
A file in the site’s folder or a parent folder | That folder and below |
What each tool writes to .htaccess
This is the part that surprises people. According to a cPanel article about the command-line PHP version on CloudLinux, when you change the version in MultiPHP Manager, it updates the .htaccess configuration in the document root of that domain. That generated block starts with a comment like “php — BEGIN cPanel-generated handler, do not edit” and contains an AddHandler line naming a cPanel PHP package. The same article says that .htaccess files with a cPanel-generated PHP version configuration “will override PHP Selector’s System PHP Version”. It also says PHP Selector only sets a single version for the whole account. That is that article’s wording about the command line. The separate cPanel article described in the next section gives the comparison that decides the question for the web server: if the version in the domain’s MultiPHP Manager setting matches the server default, the web server defers to PHP Selector.
A second cPanel article, about a site that stops loading after an account transfer, adds that MultiPHP Manager “does not modify the .htaccess files for directories that are not document root directories”. So a handler line in a sub-folder’s .htaccess is not updated when you change the version in the panel.
What cPanel says decides between MultiPHP Manager and PHP Selector
cPanel has an article called “Using the MultiPHP Manager with CloudLinux’s PHP Selector” that explains how the web server (Apache or LiteSpeed) knows which version to use:
- MultiPHP Manager sets a version for each document root. A domain that shares another domain’s document root, such as an alias domain, shares its PHP version too.
- PHP Selector sets one version for the entire cPanel account.
- The web server compares the server’s default (“native”) version with the version the domain uses in MultiPHP Manager. If they match, it uses the version chosen in PHP Selector. It does not matter whether the domain is set to inherit or explicitly set to that same version.
- cPanel strongly encourages setting MultiPHP Manager to inherit if you want to use PHP Selector, so that Selector keeps being used if the server’s default version changes.
The article also says PHP Selector versions can be set per directory on the lsapi or suPHP handlers by using the command line, and points to CloudLinux’s documentation for that; it does not cover the steps. In plain terms: if your MultiPHP Manager version for the domain is not the server default, PHP Selector is not what decides the version, whatever Selector shows.
The priority order on LiteSpeed with CloudLinux
LiteSpeed’s documentation for PHP Selector on cPanel gives the rules for servers running LiteSpeed Web Server with CloudLinux. In order:
- The server looks for an
.htaccessin the folder of the requested file, then in its parent folders. If it finds none, the system default PHP version is used. - If CageFS is disabled for the account, PHP Selector is not active, and the version named in
.htaccessis used. - If CageFS is enabled and the
.htaccessnames a version that is not the system default, the.htaccessversion wins. - If CageFS is enabled and the
.htaccessnames the system default, PHP Selector decides: if Selector is set tonative, the.htaccessversion is used, and if it is set to any other version, the Selector version is used.
The same page adds two notes for cPanel’s MultiPHP Manager: PHP Selector is only used when a domain’s MultiPHP version matches the cPanel system default, and a manually configured PHP handler takes priority over automatic detection.
These rules describe LiteSpeed plus CloudLinux, and should not be copied wholesale to another setup. On Apache, whether a handler line works depends on the PHP handler in use (the cPanel per-directory article below says its method needs suPHP and does not work with PHP-FPM) and on whether PHP Selector is in use. Find out which stack and handler you have before you apply any of these rules. Your host can tell you.
Two documented limits of the .htaccess method
- PHP-FPM. cPanel’s article on setting a different PHP version per directory warns that its
.htaccessmethod “will not work if using PHP-FPM”, so the handler line may have no effect. The PHP-FPM column in MultiPHP Manager shows whether a domain uses it. - PHP Selector. The same article warns that sites using PHP Selector “should not use” its procedure, which uses a cPanel
ea-phphandler. That is a warning not to use the procedure, which is different from the line being ignored. On my account theea-php84handler gave a 403 where analt-php84handler worked, so a handler name that does not match the server’s PHP packages can end in an error page.
A quick way to work out which setting is winning
- What does the web actually run? Put a one-line file with
<?php echo PHP_VERSION;in the site’s folder, open it, and delete it afterwards. - Is there an .htaccess in that folder or a parent? Look for
AddHandlerorSetHandlerlines, including the cPanel-generated block in the document root. - What does MultiPHP Manager say for the domain? Is it a specific version, or “inherit”?
- What does PHP Selector say? Is it a version, or “native”?
- Is PHP-FPM on? If so,
AddHandlerlines in.htaccessmay be ignored.
If the version still does not make sense, ask your host. Some of these settings (CageFS, the system default, handler mappings) are only visible in WHM.
