Articles in this section

The wrong PHP version is shown on domain phpinfo() page when LiteSpeed is in use

kb: technical

Symptoms

  • PHP 8.2 is selected for the domain example.com in Plesk > Domains > example.com > PHP Settings,
  • Accessing the phpinfo() page via Domains > example.com > PHP Setting page displays PHP version 7.4 instead of the configured version.

Cause

The behavior occurs because of custom PHP handler directives defined in the domain’s .htaccess file. These directives override the PHP version configured in Plesk and force the use of a different handler.

Resolution

  1. Log into Plesk.
  2. Open the .htaccess file in Domains > example.com > Files.
  3. Locate the section that defines the PHP handler, for example:

    CONFIG_TEXT: <IfModule mime_module>
    AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
    </IfModule>

    Comment out these lines so they are no longer applied:

    CONFIG_TEXT: #<IfModule mime_module>
    #AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
    #</IfModule>

  4. After saving the changes, the domain will use the PHP version configured in Plesk, and the phpinfo() page should reflect PHP 8.2 as expected.
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.