Articles in this section

How to change PHP version for webmail in Plesk for Linux?

kb: how-to Plesk for Linux ABT: Group A

Applicable to:

  • Plesk for Linux

Question

How to change the PHP version for webmail in Plesk for Linux?

Answer

Note: Roundcube webmail now uses PHP 8.3 in Plesk on all supported OSes except RHEL 7, CentOS 7, CloudLinux 7 and Ubuntu 18.04.

Note: Horde webmail does not provide support for PHP 8.0 and later versions due to internal limitations. It uses the latest supported PHP version - 7.4. For security reasons, we recommend to switch to Roundcube webmail instead.

  1. Connect to your Plesk server via SSH.
  2. Create a directory for custom configuration templates:

    # mkdir -p /usr/local/psa/admin/conf/templates/custom/webmail

  3. Copy original file roundcube.php to the created directory:

    # cp /usr/local/psa/admin/conf/templates/default/webmail/roundcube.php /usr/local/psa/admin/conf/templates/custom/webmail/

  4. Run the command below to list all available PHP versions. If a required PHP version is not listed, install it using the steps from this KB article.

    # plesk bin php_handler --list | grep fastcgi

    id: display name:
    plesk-php83-fastcgi    8.3.16
    plesk-php84-fastcgi    8.4.3

  5. Modify the configuration file of Roundcube:

    5.1. Open the roundcube.php file in a text editor. In this example, we are using the vi editor:

    # vi /usr/local/psa/admin/conf/templates/custom/webmail/roundcube.php

    5.2. Change the PHP handler to any other id from step 4. In this example, we are setting PHP version 8.4:

    • Before

      FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX "<?php echo $roundcubePhpHandler; ?>"

    • After

      FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX plesk-php84-fastcgi

    5.3. Save the changes and close the file.

  6. Regenerate configuration files to apply the changes:

    # plesk repair web -y

Was this article helpful?

Comments

1 comment
Date Votes
  • Unfortunately, the process is failing.
    I consistently encounter the error: 'Unsupported PHP version. Required PHP >= 7.3.'

    LiteSpeed is not installed
    mv /usr/local/bin/lsphp /usr/local/bin/lsphp-bk
    mv: cannot stat '/usr/local/bin/lsphp': No such file or directory


     

    0

Please sign in to leave a comment.