Resolved Webmail system php handler

Discussion in 'Plesk Onyx for Linux' started by Rudi Servo, Apr 20, 2017.

  1. Rudi Servo

    Rudi Servo New Pleskian

    2
    70%
    Joined:
    Apr 20, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Portugal
    I get 500 error on webmail, installing horde gives a hole lot of issues.

    this system is an upgrade from 14.04 to 16.04 and if failed to recognize the system php handler right from the start.

    I followed this
    Webmail shows 500 Internal Server Error: can not find appropriate version of php

    and this
    Resolved - Webmail (horde or roundcube) shows error 500

    and I still cant get it working...

    bellow are some outputs if you can give me a fix I do appreciate it.

    Code:
    root@w1:~# /usr/local/psa/admin/bin/php_handlers_control --list
                    id:  display name:  version:    type:                         cgi-bin:                    cli-bin:                        php.ini:  system:         service:                           pool.d:
                    fpm            7.0     7.1.4  fastcgi                 /usr/bin/php-cgi            /usr/bin/php-cgi        /etc/php/7.0/fpm/php.ini                                                           
        plesk-php70-fpm         7.0.18    7.0.18      fpm  /opt/plesk/php/7.0/sbin/php-fpm  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini        *  plesk-php70-fpm  /opt/plesk/php/7.0/etc/php-fpm.d
    plesk-php56-fastcgi         5.6.30    5.6.30  fastcgi   /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini        *                                                   
    plesk-php55-fastcgi         5.5.38    5.5.38  fastcgi   /opt/plesk/php/5.5/bin/php-cgi  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini        *                                                   
    plesk-php70-fastcgi         7.0.18    7.0.18  fastcgi   /opt/plesk/php/7.0/bin/php-cgi  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini        *                                                   
        plesk-php55-cgi         5.5.38    5.5.38      cgi   /opt/plesk/php/5.5/bin/php-cgi  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini        *                                                   
        plesk-php70-cgi         7.0.18    7.0.18      cgi   /opt/plesk/php/7.0/bin/php-cgi  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini        *                                                   
        plesk-php71-fpm          7.1.4     7.1.4      fpm  /opt/plesk/php/7.1/sbin/php-fpm  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini        *  plesk-php71-fpm  /opt/plesk/php/7.1/etc/php-fpm.d
        plesk-php56-fpm         5.6.30    5.6.30      fpm  /opt/plesk/php/5.6/sbin/php-fpm  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini        *  plesk-php56-fpm  /opt/plesk/php/5.6/etc/php-fpm.d
    plesk-php71-fastcgi          7.1.4     7.1.4  fastcgi   /opt/plesk/php/7.1/bin/php-cgi  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini        *                                                   
        plesk-php71-cgi          7.1.4     7.1.4      cgi   /opt/plesk/php/7.1/bin/php-cgi  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini        *                                                   
        plesk-php56-cgi         5.6.30    5.6.30      cgi   /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini        *                                                   
        plesk-php55-fpm         5.5.38    5.5.38      fpm  /opt/plesk/php/5.5/sbin/php-fpm  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini        *  plesk-php55-fpm  /opt/plesk/php/5.5/etc/php-fpm.d
    root@w1:~#
    
    Code:
    root@w1:~# plesk db "select section,name from ServiceNodeEnvironment where section='phphandlers';"
    +-------------+------------------------------------------+
    | section     | name                                     |
    +-------------+------------------------------------------+
    | phphandlers | baa4eaf642a2e6c9fb37e875ce514cec9f7b6569 |
    | phphandlers | fpm                                      |
    | phphandlers | plesk-php55-cgi                          |
    | phphandlers | plesk-php55-fastcgi                      |
    | phphandlers | plesk-php55-fpm                          |
    | phphandlers | plesk-php56-cgi                          |
    | phphandlers | plesk-php56-fastcgi                      |
    | phphandlers | plesk-php56-fpm                          |
    | phphandlers | plesk-php70-cgi                          |
    | phphandlers | plesk-php70-fastcgi                      |
    | phphandlers | plesk-php70-fpm                          |
    | phphandlers | plesk-php71-cgi                          |
    | phphandlers | plesk-php71-fastcgi                      |
    | phphandlers | plesk-php71-fpm                          |
    | phphandlers | synced                                   |
    +-------------+------------------------------------------+
    



    Code:
    root@w1:~# /usr/local/psa/admin/bin/php_handlers_control --reread
    Error adding handler from /etc/psa/php_versions.d/php5-fpm.conf: Handler with id = `fpm' already exists
    Error adding handler from /etc/psa/php_versions.d/php-cgi.conf: Handler with id = `cgi' already exists
    Error adding handler from /etc/psa/php_versions.d/php-fpm.conf: Handler with id = `fpm' already exists
    Error adding handler from /etc/psa/php_versions.d/php-fastcgi.conf: Handler with id = `fastcgi' already exists
    Error adding handler from /etc/psa/php_versions.d/php-module.conf: Handler with id = `module' already exists
    [Warning] removing handler `' (cgi) as corresponding /usr/bin/php5-cgi doesn't exist
    [Warning] removing handler `' (module) as corresponding /usr/bin/php5-cgi doesn't exist
    [Warning] removing handler `' (fastcgi) as corresponding /usr/bin/php5-cgi doesn't exist
    


     
  2. IgorG

    IgorG Forums Analyst Plesk Team

    43
    84%
    Joined:
    Oct 27, 2009
    Messages:
    23,091
    Likes Received:
    795
    Location:
    Novosibirsk, Russia
    First of all I'd remove strange 'fpm' handler. Do you really have vendor's PHP version 7.x? As far as I see it is conflicted with default 'fpm' handler from
    /etc/psa/php_versions.d/php5-fpm.conf
    Also there is strange /etc/psa/php_versions.d/php-fpm.conf defined as additional 'fpm' handler. What is this? Try to remove it.
    Then reread handlers again.
     
  3. UFHH01

    UFHH01 Plesk addicted! Plesk Guru

    43
    64%
    Joined:
    Jun 11, 2013
    Messages:
    5,380
    Likes Received:
    1,161
    Location:
    Hamburg / Germany
    Best Answer
    Hi Rudi Servo,

    upgrading from Ubuntu 14.04 to Ubuntu 16.04 includes some major changes, where "/etc/php5" changes to "/etc/php". You have to modify/edit your corresponding vendor PHP - handlers to avoid errors/issues/problems.


    My following examples include the well-know PHP versions from => Ondřej Surý ( which includes PHP versions 5.6, 7.0 and 7.1 ) and should give you a hint, what you should modify/edit, in order to avoid issues/errors/problems with Plesk:
    Code:
                      id:                   display name:  full version:  version:    type:                         cgi-bin:                    php-cli:                        php.ini:  custom:  status:
                      
                      cgi  7.1.4 by OS vendor ( default )          7.1.4       7.1      cgi                 /usr/bin/php-cgi                /usr/bin/php        /etc/php/7.1/cgi/php.ini    false  enabled
                  fastcgi  7.1.4 by OS vendor ( default )          7.1.4       7.1  fastcgi                 /usr/bin/php-cgi                /usr/bin/php        /etc/php/7.1/cgi/php.ini    false  enabled
                      fpm  7.1.4 by OS vendor ( default )          7.1.4       7.1      fpm             /usr/sbin/php-fpm7.1                /usr/bin/php        /etc/php/7.1/fpm/php.ini    false  enabled
                   module  7.1.4 by OS vendor ( default )          7.1.4       7.1   module                 /usr/bin/php-cgi                /usr/bin/php    /etc/php/7.1/apache2/php.ini    false  enabled
                  
               php5.6-cgi              5.6.30 by sury.org         5.6.30       5.6      cgi              /usr/bin/php-cgi5.6             /usr/bin/php5.6        /etc/php/5.6/cgi/php.ini     true  enabled
           php5.6-fastcgi              5.6.30 by sury.org         5.6.30       5.6  fastcgi              /usr/bin/php-cgi5.6             /usr/bin/php5.6        /etc/php/5.6/cgi/php.ini     true  enabled
               php5.6-fpm              5.6.30 by sury.org         5.6.30       5.6      fpm             /usr/sbin/php-fpm5.6             /usr/bin/php5.6        /etc/php/5.6/fpm/php.ini     true  enabled
              
               php7.0-cgi              7.0.18 by sury.org         7.0.18       7.0      cgi              /usr/bin/php-cgi7.0             /usr/bin/php7.0        /etc/php/7.0/cgi/php.ini     true  enabled
           php7.0-fastcgi              7.0.18 by sury.org         7.0.18       7.0  fastcgi              /usr/bin/php-cgi7.0             /usr/bin/php7.0        /etc/php/7.0/cgi/php.ini     true  enabled
               php7.0-fpm              7.0.18 by sury.org         7.0.18       7.0      fpm             /usr/sbin/php-fpm7.0             /usr/bin/php7.0        /etc/php/7.0/fpm/php.ini     true  enabled
              
               php7.1-cgi               7.1.3 by sury.org          7.1.4       7.1      cgi              /usr/bin/php-cgi7.1             /usr/bin/php7.1        /etc/php/7.1/cgi/php.ini     true  enabled
           php7.1-fastcgi               7.1.3 by sury.org          7.1.4       7.1  fastcgi              /usr/bin/php-cgi7.1             /usr/bin/php7.1        /etc/php/7.1/cgi/php.ini     true  enabled
               php7.1-fpm               7.1.3 by sury.org          7.1.4       7.1      fpm             /usr/sbin/php-fpm7.1             /usr/bin/php7.1        /etc/php/7.1/fpm/php.ini     true  enabled
               
          plesk-php54-cgi                          5.4.45         5.4.45       5.4      cgi   /opt/plesk/php/5.4/bin/php-cgi  /opt/plesk/php/5.4/bin/php  /opt/plesk/php/5.4/etc/php.ini     true disabled
      plesk-php54-fastcgi                          5.4.45         5.4.45       5.4  fastcgi   /opt/plesk/php/5.4/bin/php-cgi  /opt/plesk/php/5.4/bin/php  /opt/plesk/php/5.4/etc/php.ini     true disabled
          plesk-php54-fpm                          5.4.45         5.4.45       5.4      fpm  /opt/plesk/php/5.4/sbin/php-fpm  /opt/plesk/php/5.4/bin/php  /opt/plesk/php/5.4/etc/php.ini     true disabled
          
          plesk-php55-cgi                          5.5.38         5.5.38       5.5      cgi   /opt/plesk/php/5.5/bin/php-cgi  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini     true disabled
      plesk-php55-fastcgi                          5.5.38         5.5.38       5.5  fastcgi   /opt/plesk/php/5.5/bin/php-cgi  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini     true disabled
          plesk-php55-fpm                          5.5.38         5.5.38       5.5      fpm  /opt/plesk/php/5.5/sbin/php-fpm  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini     true disabled
          
          plesk-php56-cgi                          5.6.30         5.6.30       5.6      cgi   /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini     true  enabled
      plesk-php56-fastcgi                          5.6.30         5.6.30       5.6  fastcgi   /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini     true  enabled
          plesk-php56-fpm                          5.6.30         5.6.30       5.6      fpm  /opt/plesk/php/5.6/sbin/php-fpm  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini     true  enabled
          
          plesk-php70-cgi                          7.0.17         7.0.17       7.0      cgi   /opt/plesk/php/7.0/bin/php-cgi  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini     true  enabled
      plesk-php70-fastcgi                          7.0.17         7.0.17       7.0  fastcgi   /opt/plesk/php/7.0/bin/php-cgi  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini     true  enabled
          plesk-php70-fpm                          7.0.17         7.0.17       7.0      fpm  /opt/plesk/php/7.0/sbin/php-fpm  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini     true  enabled
          
          plesk-php71-cgi                           7.1.3          7.1.3       7.1      cgi   /opt/plesk/php/7.1/bin/php-cgi  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini     true  enabled
      plesk-php71-fastcgi                           7.1.3          7.1.3       7.1  fastcgi   /opt/plesk/php/7.1/bin/php-cgi  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini     true  enabled
          plesk-php71-fpm                           7.1.3          7.1.3       7.1      fpm  /opt/plesk/php/7.1/sbin/php-fpm  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini     true  enabled
     
  4. Rudi Servo

    Rudi Servo New Pleskian

    2
    70%
    Joined:
    Apr 20, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Portugal
    ok how do I do that?
     
  5. Rudi Servo

    Rudi Servo New Pleskian

    2
    70%
    Joined:
    Apr 20, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Portugal
    all php5.X are from plesk repos
    only have php 7.0 and 7.1 from ondrej

    Code:
    root@w1:~# /usr/local/psa/bin/php_handler --remove -id fpm
    Unable to remove the PHP handler: You can remove only custom handlers.
    
     
  6. UFHH01

    UFHH01 Plesk addicted! Plesk Guru

    43
    64%
    Joined:
    Jun 11, 2013
    Messages:
    5,380
    Likes Received:
    1,161
    Location:
    Hamburg / Germany
    Hi Rudi Servo,

    pls. consider to READ the official Plesk documentation, so that you are able to use the CLI - commands without errors.

    Pls. keep in mind, that PHP - handlers which are NOT defined as "custom" handlers, shouldn't ( and can't ) be deleted, because these are you STANDART PHP - handlers on your server - they have to be EDITED in case of misconfigurations. ;)


     
  7. Rudi Servo

    Rudi Servo New Pleskian

    2
    70%
    Joined:
    Apr 20, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Portugal
    For future reference. I was able to fix it.

    The previous Installation of plesk left on the /etc/psa/php_versions.d/php5-cgi.conf and other files, they should have been deleted upon upgrading from 12.5 to 17.0.

    so deleting the php5-*, not the ones from the newer installations
    updating my alternatives because I have two php system version to

    Code:
    # update-alternatives --set php-cgi /usr/bin/php-cgi7.0
    # update-alternatives --set php /usr/bin/php7.0
    
    Add to remove old fpm or cgi screw up's

    Code:
    # /usr/local/psa/admin/bin/php_handlers_control --remove --id fpm
    a simple

    Code:
    # /usr/local/psa/admin/bin/php_handlers_control --reread

    and everything is in place


    Code:
                    id:  display name:  version:    type:                         cgi-bin:                    cli-bin:                        php.ini:  system:         service:                           pool.d:
        plesk-php70-fpm         7.0.18    7.0.18      fpm  /opt/plesk/php/7.0/sbin/php-fpm  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini        *  plesk-php70-fpm  /opt/plesk/php/7.0/etc/php-fpm.d
    plesk-php56-fastcgi         5.6.30    5.6.30  fastcgi   /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini        *                                                  
    plesk-php55-fastcgi         5.5.38    5.5.38  fastcgi   /opt/plesk/php/5.5/bin/php-cgi  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini        *                                                  
    plesk-php70-fastcgi         7.0.18    7.0.18  fastcgi   /opt/plesk/php/7.0/bin/php-cgi  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini        *                                                  
        plesk-php55-cgi         5.5.38    5.5.38      cgi   /opt/plesk/php/5.5/bin/php-cgi  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini        *                                                  
                    cgi         7.0.18    7.0.18      cgi                 /usr/bin/php-cgi                /usr/bin/php        /etc/php/7.0/cgi/php.ini        *                                                  
        plesk-php70-cgi         7.0.18    7.0.18      cgi   /opt/plesk/php/7.0/bin/php-cgi  /opt/plesk/php/7.0/bin/php  /opt/plesk/php/7.0/etc/php.ini        *                                                  
                    fpm         7.0.18    7.0.18      fpm             /usr/sbin/php-fpm7.0                /usr/bin/php        /etc/php/7.0/fpm/php.ini        *       php7.0-fpm          /etc/php/7.0/fpm/pool.d/
                fastcgi         7.0.18    7.0.18  fastcgi                 /usr/bin/php-cgi                /usr/bin/php        /etc/php/7.0/cgi/php.ini        *                                                  
        plesk-php71-fpm          7.1.4     7.1.4      fpm  /opt/plesk/php/7.1/sbin/php-fpm  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini        *  plesk-php71-fpm  /opt/plesk/php/7.1/etc/php-fpm.d
        plesk-php56-fpm         5.6.30    5.6.30      fpm  /opt/plesk/php/5.6/sbin/php-fpm  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini        *  plesk-php56-fpm  /opt/plesk/php/5.6/etc/php-fpm.d
    plesk-php71-fastcgi          7.1.4     7.1.4  fastcgi   /opt/plesk/php/7.1/bin/php-cgi  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini        *                                                  
        plesk-php71-cgi          7.1.4     7.1.4      cgi   /opt/plesk/php/7.1/bin/php-cgi  /opt/plesk/php/7.1/bin/php  /opt/plesk/php/7.1/etc/php.ini        *                                                  
                 module         7.0.18    7.0.18   module                 /usr/bin/php-cgi                /usr/bin/php    /etc/php/7.0/apache2/php.ini        *                                                  
        plesk-php56-cgi         5.6.30    5.6.30      cgi   /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini        *                                                  
        plesk-php55-fpm         5.5.38    5.5.38      fpm  /opt/plesk/php/5.5/sbin/php-fpm  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini        *  plesk-php55-fpm  /opt/plesk/php/5.5/etc/php-fpm.d
    root@w1:/etc/psa/php_versions.d#
    
     
Loading...