• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue RoundCube issues after upgrade

Izaim

Basic Pleskian
Environment:
Plesk Onyx #Update 3.
Ubuntu 16.04.1

Issue:
I am experiencing a big RoundCube issue after upgrading from Ubuntu 14 to 16, PHP5 is replaced with PHP7 and system's FastCGI is not working anymore. I get Error 500 everytime I try to access webmail.domain.com

b0867e829ce94b978b70227c5a79f45a.jpeg
These are the Apache logs for this issue:

[Sun Oct 23 04:17:07.280711 2016] [fcgid:warn] [pid 1711:tid 139629610878720] (104)Connection reset by peer: [client 77.28.133.***:57154] mod_fcgid: error reading data from FastCGI server

[Sun Oct 23 04:17:07.280729 2016] [core:error] [pid 1711:tid 139629610878720] [client 77.28.133.***:57154] End of script output before headers: index.php


Second,

4afd06a0e7884ed2886f86c82efab566.jpeg

This looks a little messed up here, mod_php?
As you can see, there is no 'FastCGI application' for system's PHP 7.0.8 manually re-named as 7.0 here. But it exists for PHP version installed from Plesk repos.

I think RoundCube uses a system FastCGI mod. Can Plesk somehow make RoundCube work with php7.0-psa component instead of Ubuntu's defaul php7.0?


Already tried:
https://kb.plesk.com/en/121251
https://kb.plesk.com/en/120785
https://kb.plesk.com/en/121093

Tried so hard to fix this. Can Plesk get a fix for this on the next Update somehow?
And please update RoundCube to 1.2.2.
 
Last edited:
Hi Izaim O.,

after upgrading from Ubuntu 14 to 16, PHP5 is replaced with PHP7
You missed a very important part, when you made your dist-upgrade:

Quoted from: => How to perform dist-upgrade procedure on server with Plesk ( KB - article 126808 )
...
During an upgrade from Ubuntu 14 to Ubuntu 16, system PHP 5.x shipped by OS vendor will be upgraded to PHP 7.x. So to avoid any PHP compatibility issues, before an upgrade, it is highly recommended to switch all sites having PHP handler 5x by OS vendor to corresponding custom PHP handlers. Please refer to these KB articles for details: KB #124991 KB #129167.
...

You should consider to repair the previous vendor php - paths in your psa - database ( from "php5" to "php" ) manually, when you made the dist-upgrade. As you can see in your screenshot, the non-custom vendor php - handlers are in a broken state and need to be repaired.
 
Hi Izaim O.,


You missed a very important part, when you made your dist-upgrade:

Quoted from: => How to perform dist-upgrade procedure on server with Plesk ( KB - article 126808 )


You should consider to repair the previous vendor php - paths in your psa - database ( from "php5" to "php" ) manually, when you made the dist-upgrade. As you can see in your screenshot, the non-custom vendor php - handlers are in a broken state and need to be repaired.


Hostnames like webmail.domain.com does not use PHP handlers that you can configure from Plesk GUI like other regular domains. Also you cannot make them use a selected PHP handler via CLI.

How do I repair system broken PHP handler?
 
I have no FastCGI on System PHP, this is why Roundcube fails in my opinion. I have no problems with hosted domains who use php7.0-psa fpm, cgi or fastcgi
 

Attachments

  • nofcgi.jpg
    nofcgi.jpg
    243.3 KB · Views: 12
Hi Izaim O.,

the clue is, that "mod_php" depends on "libapache2-mod-php" to be installed and activated for your apache2 - webserver ( module "php5" ). To be able to enable "php5", you must use "mpm-prefork".

But ( !!! ), pls. be informed that the "Apache module" is outdated and insecure. Pls. Consider to use FastCGI or PHP-FPM instead.


FastCGI has the same definitions as CGI and will be executed over a wrapper. The only difference at the Plesk - php_handler settings is, that you should use "fastcgi", instead of "cgi". ;)
 
Hi Izaim O.,

the clue is, that "mod_php" depends on "libapache2-mod-php" to be installed and activated for your apache2 - webserver ( module "php5" ). To be able to enable "php5", you must use "mpm-prefork".

But ( !!! ), pls. be informed that the "Apache module" is outdated and insecure. Pls. Consider to use FastCGI or PHP-FPM instead.


FastCGI has the same definitions as CGI and will be executed over a wrapper. The only difference at the Plesk - php_handler settings is, that you should use "fastcgi", instead of "cgi". ;)


Uwe got ya,

I really don't want to use PHP5 anymore, I just want to fix this default PHP7 version with FastCGI and put it to work because all my webmails.* are down. That's my priority. But I failed to do so.
 
Hi Izaim O.,

here are my ( working ) modifications for Ubuntu 16.04 and Plesk Onyx :

Code:
                  id:        display name:  full version:  version:    type:                         cgi-bin:                    php-cli:                        php.ini:  custom:  status:
                  
                  cgi  7.0.12 by OS vendor         7.0.12       7.0      cgi                 /usr/bin/php-cgi                /usr/bin/php        /etc/php/7.0/cgi/php.ini    false  enabled
              fastcgi  7.0.12 by OS vendor         7.0.12       7.0  fastcgi                 /usr/bin/php-cgi                /usr/bin/php        /etc/php/7.0/cgi/php.ini    false  enabled
                  fpm  7.0.12 by OS vendor         7.0.12       7.0      fpm             /usr/sbin/php-fpm7.0                /usr/bin/php        /etc/php/7.0/fpm/php.ini    false  enabled
               module  7.0.12 by OS vendor         7.0.12       7.0   module                 /usr/bin/php-cgi                /usr/bin/php    /etc/php/7.0/apache2/php.ini    false  enabled

File: /etc/psa/php_versions.json

Code:
{
    "id":"module",
    "path":"/usr/bin/php-cgi",
    "clipath":"/usr/bin/php",
    "phpini":"/etc/php/7.0/apache2/php.ini",
    "version":"7.0.12",
    "displayname":"%24version",
    "type":"module",
    "system":true
},
{
    "id":"cgi",
    "path":"/usr/bin/php-cgi",
    "clipath":"/usr/bin/php",
    "phpini":"/etc/php/7.0/cgi/php.ini",
    "version":"7.0.12",
    "displayname":"%24version",
    "type":"cgi",
    "system":true
},
{
    "id":"fastcgi",
    "path":"/usr/bin/php-cgi",
    "clipath":"/usr/bin/php",
    "phpini":"/etc/php/7.0/cgi/php.ini",
    "version":"7.0.12",
    "displayname":"%24version",
    "type":"fastcgi",
    "system":true
},
{
    "id":"fpm",
    "path":"/usr/sbin/php-fpm7.0",
    "clipath":"/usr/bin/php",
    "phpini":"/etc/php/7.0/fpm/php.ini",
    "version":"7.0.12",
    "displayname":"%24version",
    "type":"fpm",
    "system":true,
    "service":"php-fpm",
    "poold":"/etc/php/7.0/fpm/pool.d"
},


... ( HERE ARE THE OTHER FOLLOWING PHP - HANDLERS ) ...

Database: psa > ServiceNodeEnvironment >

Code:
DATABASE:     psa > ServiceNodeEnvironment > 

serviceNodeId    1
section        phphandlers
name            cgi
value            <?xml version="1.0"?>
<handler><id>cgi</id><type>cgi</type><typeName>CGI application</typeName><version>7.0</version><fullVersion>7.0.12</fullVersion><displayname>7.0.12</displayname><path>/usr/bin/php-cgi</path><clipath>/usr/bin/php</clipath><phpini>/etc/php/7.0/cgi/php.ini</phpini><custom>false</custom><registered>true</registered><service></service><poold></poold></handler>

serviceNodeId    1
section        phphandlers
name            fastcgi
value            <?xml version="1.0"?>
<handler><id>fastcgi</id><type>fastcgi</type><typeName>FastCGI application</typeName><version>7.0</version><fullVersion>7.0.12</fullVersion><displayname>7.0.12</displayname><path>/usr/bin/php-cgi</path><clipath>/usr/bin/php</clipath><phpini>/etc/php/7.0/cgi/php.ini</phpini><custom>false</custom><registered>true</registered><service></service><poold></poold></handler>

serviceNodeId    1
section        phphandlers
name            fpm
value            <?xml version="1.0"?>
<handler><id>fpm</id><type>fpm</type><typeName>FPM application</typeName><version>7.0</version><fullVersion>7.0.12</fullVersion><displayname>7.0.12</displayname><path>/usr/sbin/php-fpm7.0</path><clipath>/usr/bin/php</clipath><phpini>/etc/php/7.0/fpm/php.ini</phpini><custom>false</custom><registered>true</registered><service>php-fpm</service><poold>/etc/php/7.0/fpm/pool.d</poold></handler>

serviceNodeId    1
section        phphandlers
name            module
value            <?xml version="1.0"?>
<handler><id>module</id><type>module</type><typeName>Apache module</typeName><version>7.0</version><fullVersion>7.0.12</fullVersion><displayname>7.0.12</displayname><path>/usr/bin/php-cgi</path><clipath>/usr/bin/php</clipath><phpini>/etc/php/7.0/apache2/php.ini</phpini><custom>false</custom><registered>true</registered><service></service><poold></poold></handler>

Database: psa > ServiceNodeEnvironment >

Code:
DATABASE:     psa > ServiceNodeEnvironment > 

serviceNodeId    1
section        phpHandlersSettings
name            cgi
value           <?xml version="1.0"?>
<handler>PLEASE_USE_THE_VALUES_FROM_YOUR_WORKING_PHP_HANDLERS_BECAUSE_YOU_MIGHT_HAVE_SETUP_YOUR_VERY_OWN_UNIQUE_SETTINGS_HERE</handler>

serviceNodeId    1
section        phpHandlersSettings
name            fastcgi
value           <?xml version="1.0"?>
<handler>PLEASE_USE_THE_VALUES_FROM_YOUR_WORKING_PHP_HANDLERS_BECAUSE_YOU_MIGHT_HAVE_SETUP_YOUR_VERY_OWN_UNIQUE_SETTINGS_HERE</handler>

serviceNodeId    1
section        phpHandlersSettings
name            fpm
value           <?xml version="1.0"?>
<handler>PLEASE_USE_THE_VALUES_FROM_YOUR_WORKING_PHP_HANDLERS_BECAUSE_YOU_MIGHT_HAVE_SETUP_YOUR_VERY_OWN_UNIQUE_SETTINGS_HERE</handler>

serviceNodeId    1
section        phpHandlersSettings
name            module
value           <?xml version="1.0"?>
<handler>PLEASE_USE_THE_VALUES_FROM_YOUR_WORKING_PHP_HANDLERS_BECAUSE_YOU_MIGHT_HAVE_SETUP_YOUR_VERY_OWN_UNIQUE_SETTINGS_HERE</handler>

Database: psa > ServiceNodeConfiguration >

Code:
DATABASE:     psa > ServiceNodeEnvironment > 

serviceNodeId    1
section        phphandlers
name            cgi
value           <?xml version="1.0"?>
<handler-configuration><enabled>true</enabled><displayname>7.0.12 by OS vendor</displayname></handler-configuration>

serviceNodeId    1
section        phphandlers
name            fastcgi
value           <?xml version="1.0"?>
<handler-configuration><enabled>true</enabled><displayname>7.0.12 by OS vendor</displayname></handler-configuration>

serviceNodeId    1
section        phphandlers
name            fpm
value           <?xml version="1.0"?>
<handler-configuration><enabled>true</enabled><displayname>7.0.12 by OS vendor</displayname></handler-configuration>

serviceNodeId    1
section        phphandlers
name            module
value           <?xml version="1.0"?>
<handler-configuration><enabled>true</enabled><displayname>7.0.12 by OS vendor</displayname></handler-configuration>
 
Hi Izaim O.,

some short additional informations:

It is essential, that you turn on "php7" ( Ubuntu package "libapache2-mod-php", which depends as well on "libapache2-mod-php7.0" ) for your apache2 - modules ( with the above modifications ) and be sure, that the modules "fcgid", "proxy", "proxy_fcgi", "proxy_html" and "proxy_http" are as well turned on.
In addition it is as well necessary to use "mpm-prefork" and not "mpm-event".


I can recommend as well to install the additional packages from the well-known ppa "Ondřej Surý" => https://launchpad.net/~ondrej/+archive/ubuntu/php , which includes not only a lot of additional php - modules, but as well "php5.5", "php5.6", "php7.0" AND "php7.1", which makes it easier to downgrade back again to "php5.6", if you need this for compatibilty reasons or, what could be as well intersting for you, to use "php7.1", instead of the basic XENIAL - version "php7.0". ;) ( Pls. open another thread, if you need help here! )
 
I really appriciate your help Uwe,
I followed all your steps and I still get the same 500 error on my Roundcube.

Apache logs (http://webmail.jitops.com)
[Tue Oct 25 04:13:46.833376 2016] [fcgid:warn] [pid 7970] (104)Connection reset by peer: [client 77.28.141.222:43294] mod_fcgid: error read$
[Tue Oct 25 04:13:46.833402 2016] [core:error] [pid 7970] [client 77.28.141.222:43294] End of script output before headers: index.php


My Apache config as follows:

cf99b2f35a4646d1a5ba7916c8fd789c.jpeg

PHP Settings

2b57fb79d3ff4cd1b04c1525d5ac6b60.jpeg
 
Hi Izaim O.,

according to your screenshot, you still have a missing "FastCGI" - handler from your vendor's php version! Pls. have another closer look at => #7 and add missing DB - entries manually and definitions at "/etc/psa/php_versions.json", to solve your issue.
 
Hi @UFHH01

Your solution worked! But everytime I make a change on Plesk on any domain or component. That handler goes away like it never existed and everything I changed is back to "normal". The FastCGI entry I added manually on "psa" database and on "php_version.json" gets removed automaticlly. Error 500 back again.

This issue is becoming a little booring, you are not obligated to reply me, I think I am giving up. Thank you so much!
 
Hi Izaim O.,

pls. fill in a BUG REPORT, because this IS a bug, which should be inspected and corrected by the Plesk team.

---------------------------------------------------------------
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

PROBLEM DESCRIPTION

STEPS TO REPRODUCE

ACTUAL RESULT

EXPECTED RESULT

ANY ADDITIONAL INFORMATION
--------------------------------------------------------------

The Plesk "php_handler" seems to rely on "php5" only, ignoring the fact, that for Ubuntu 16.04, the whole php - functionality has been changed to "php" and "php7".


... and because we are all a bit lazy as well ( *ironic* :D:p:D ), we call for some help from some Plesk - Team - Members, by adding them with an "@" in front, as for example: @IgorG // @mizar
 
@Izaim O. what about just remove Roundcube, then run

# plesk bin php_handler --reread

and install Roundcube component back?
I'd encourage you to try it out.
 
@Izaim O. what about just remove Roundcube, then run

# plesk bin php_handler --reread

and install Roundcube component back?
I'd encourage you to try it out.

After I apply the changes that Uwe suggests?
(bcz they're all reset now, no system fastcgi available on PHP settings)
 
After I apply the changes that Uwe suggests?
No, all customizations should be removed. Reset all to default state and perform actions suggested by me. If you see the same problem after that - please fill bugreport form in detail.
 
Unfortunately, Same sh:eek:. :rolleyes::mad:
I think I will have to order a new Dedicated instance and run a fresh Onyx install on it and migrate from Plesk Migrator my websites. All my client's webmails are down. Will fill the bugreport soon.

Thanks @UFHH01 Thanks @IgorG
 
Hi Izaim O.,

another ( just tested and confirmed working as expected on Debian and Ubuntu systems, which have no more "php5" depending services after an system - PHP - version - upgrade to PHP 7.x ) solution is to "cheat", so that the Plesk PHP-Handler finds what it is looking for.

We create the "old" folder "/etc/php5", which might have been deleted, or removed during the PHP - version upgrade, afterwards we copy the basic folder ( in this example for PHP 7.0 ) to the "php5" - folder and create 3 symlinks.

Code:
mkdir -p /etc/php5
rsync -r /etc/php/7.0/* /etc/php5
ln -s /usr/sbin/php-fpm /usr/sbin/php5-fpm
ln -s /usr/bin/php-cgi /usr/bin/php5-cgi
ln -s /usr/bin/php /usr/bin/php5

Now you are able to perform the "normal" Plesk PHP-Handler - CLI - commands:

plesk bin php_handler --reread
followed by
plesk bin php_handler --list

... which should result in:

Code:
                  cgi    7.0.12 by OS vendor          7.0.12       7.0      cgi                /usr/bin/php5-cgi               /usr/bin/php5           /etc/php5/cgi/php.ini    false  enabled
              fastcgi    7.0.12 by OS vendor          7.0.12       7.0  fastcgi                 /usr/bin/php-cgi                /usr/bin/php        /etc/php/7.0/cgi/php.ini    false  enabled
                  fpm    7.0.12 by OS vendor          7.0.12       7.0      fpm               /usr/sbin/php5-fpm               /usr/bin/php5           /etc/php5/fpm/php.ini    false  enabled
               module    7.0.12 by OS vendor          7.0.12       7.0   module                /usr/bin/php5-cgi               /usr/bin/php5       /etc/php5/apache2/php.ini    false  enabled
 
Hi Izaim O.,

another ( just tested and confirmed working as expected on Debian and Ubuntu systems, which have no more "php5" depending services after an system - PHP - version - upgrade to PHP 7.x ) solution is to "cheat", so that the Plesk PHP-Handler finds what it is looking for.

We create the "old" folder "/etc/php5", which might have been deleted, or removed during the PHP - version upgrade, afterwards we copy the basic folder ( in this example for PHP 7.0 ) to the "php5" - folder and create 3 symlinks.

Code:
mkdir -p /etc/php5
rsync -r /etc/php/7.0/* /etc/php5
ln -s /usr/sbin/php-fpm /usr/sbin/php5-fpm
ln -s /usr/bin/php-cgi /usr/bin/php5-cgi
ln -s /usr/bin/php /usr/bin/php5

Now you are able to perform the "normal" Plesk PHP-Handler - CLI - commands:

plesk bin php_handler --reread
followed by
plesk bin php_handler --list

... which should result in:

Code:
                  cgi    7.0.12 by OS vendor          7.0.12       7.0      cgi                /usr/bin/php5-cgi               /usr/bin/php5           /etc/php5/cgi/php.ini    false  enabled
              fastcgi    7.0.12 by OS vendor          7.0.12       7.0  fastcgi                 /usr/bin/php-cgi                /usr/bin/php        /etc/php/7.0/cgi/php.ini    false  enabled
                  fpm    7.0.12 by OS vendor          7.0.12       7.0      fpm               /usr/sbin/php5-fpm               /usr/bin/php5           /etc/php5/fpm/php.ini    false  enabled
               module    7.0.12 by OS vendor          7.0.12       7.0   module                /usr/bin/php5-cgi               /usr/bin/php5       /etc/php5/apache2/php.ini    false  enabled


I think my headache is over ... looks ok now, will do a few more tests and come back and announce you a "Plesk Jesus".
 
As a final recommendation and if a server administrator is as pedantic as I am ( :p:D:p ), you could as well adjust and backup your manual modifications with:

Pls. make a backup of the configuration files at "/etc/psa/php_versions.d" with
Code:
mkdir -p /etc/psa/php_versions.d/OWN_BACKUPS_OLD
rsync -r /etc/psa/php_versions.d/* /etc/psa/php_versions.d/OWN_BACKUPS_OLD
... and check and correct the paths to the real systems paths:

Check at "/etc/psa/php_versions.d"

=> "php-cgi.conf" , "php-fastcgi.conf" , "php-fpm.conf" and "php-module.conf"
=> "php5-cgi.conf" , "php5-fastcgi.conf" , "php5-fpm.conf" and "php5-module.conf"

... and manually modify "/etc/php5" to "/etc/php/7.0" .​


Your modifications could be overwritten in case of updates/upgrades/patches from Plesk, so please make another backup of your manual modified configuration files, in case you need to restore them:

Code:
mkdir -p /etc/psa/php_versions.d/OWN_BACKUPS_NEW
rsync -r /etc/psa/php_versions.d/* /etc/psa/php_versions.d/OWN_BACKUPS_NEW
 
Last edited by a moderator:
As a final recommendation and if a server administrator is as pedantic as I am ( :p:D:p ), you could as well adjust and backup your manual modifications with:

Pls. make a backup of the configuration files at "/etc/psa/php_versions.d" with​
Code:
mkdir -p /etc/psa/php_versions.d/OWN_BACKUPS_OLD[/INDENT]
[INDENT]rsync -r /etc/psa/php_versions.d/* /etc/psa/php_versions.d/OWN_BACKUPS_OLD

... and check and correct the paths to the real systems paths:​
Check at "/etc/psa/php_versions.d"​
=> "php-cgi.conf" , "php-fastcgi.conf" , "php-fpm.conf" and "php-module.conf"​
=> "php5-cgi.conf" , "php5-fastcgi.conf" , "php5-fpm.conf" and "php5-module.conf"​
... and manually modify "/etc/php5" to "/etc/php/7.0" .​



Your modifications could be overwritten in case of updates/upgrades/patches from Plesk, so please make another backup of your manual modified configuration files, in case you need to restore them:

Code:
mkdir -p /etc/psa/php_versions.d/OWN_BACKUPS_NEW[/INDENT]
[INDENT]rsync -r /etc/psa/php_versions.d/* /etc/psa/php_versions.d/OWN_BACKUPS_NEW

I think my headache is over ... looks ok now, will do a few more tests and come back and announce you a "Plesk Jesus".

I never came back but better 7 years late than never.

*** UFHH01 PLESK JESUS ***
 
Back
Top