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

Created:

2016-11-16 12:43:22 UTC

Modified:

2017-04-24 11:14:13 UTC

0

Was this article helpful?


Have more questions?

Submit a request

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

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux
  • Plesk 12.0 for Linux

Symptoms

Unable to log in to webmail:

500 Internal Server Error

The following error can be found in /var/log/messages :

May 17 01:11:49 s17892165 cgi_wrapper[448]: can not find appropriate version of php ~ `fastcgi' in `/etc/psa/php_versions.json'

Cause

Main PHP with id fastcgi is not registered.

Resolution

Download psa-php-configurator package from http://autoinstall.plesk.com/YOUR_PLESK_VERSION/DIST_VERSION/opt/php/ and reinstall it:

# dpkg -P --force-all psa-php-configurator
# wget http://autoinstall.plesk.com/PSA_17.0.17/dist-deb-Ubuntu-16.04-x86_64/opt/php/psa-php-configurator_1.7.0-ubuntu16.04.build1700161003.19_amd64.deb
# dpkg -i psa-php-configurator_1.7.0-ubuntu16.04.build1700161003.19_amd64.deb

OR

  1. Check registered PHP handlers:

    # /usr/local/psa/admin/bin/php_handlers_control --list
    id: display name: version: type: cgi-bin: cli-bin: php.ini: system
    plesk-php53-fastcgi 5.3.29 5.3.29 fastcgi /opt/plesk/php/5.3/bin/php-cgi /opt/plesk/php/5.3/bin/php /opt/plesk/php/5.3/etc/php.ini *
    plesk-php53-cgi 5.3.29 5.3.29 cgi /opt/plesk/php/5.3/bin/php-cgi /opt/plesk/php/5.3/bin/php /opt/plesk/php/5.3/etc/php.ini *
  2. Check version of main PHP handler:

    # which php-cgi
    /usr/bin/php-cgi
    # /usr/bin/php-cgi -v
    PHP 5.3.3 (cgi-fcgi) (built: May 21 2015 21:10:42)
  3. Register PHP handler with id fastcgi :

  4. for CentOS like systems

        # /usr/local/psa/bin/php_handler --add -displayname 5.3.3 -path /usr/bin/php-cgi -phpini /etc/php.ini -type fastcgi -id fastcgi
    The new PHP handler with the id "fastcgi" was successfully registered.
  5. for Ubuntu/Debian like systems

        # /usr/local/psa/bin/php_handler --add -displayname 5.3.3 -path /usr/bin/php-cgi  -clipath /usr/bin/php -phpini /etc/php5/cli/php.ini -type fastcgi -id fastcgi
    The new PHP handler with the id "fastcgi" was successfully registered.

    # /usr/local/psa/admin/bin/php_handlers_control --reread
    # /usr/local/psa/admin/bin/php_handlers_control --list
    id: display name: version: type: cgi-bin: cli-bin: php.ini: system
    fastcgi 5.3.3 5.3.3 fastcgi /usr/bin/php-cgi /etc/php.ini
    plesk-php53-fastcgi 5.3.29 5.3.29 fastcgi /opt/plesk/php/5.3/bin/php-cgi /opt/plesk/php/5.3/bin/php /opt/plesk/php/5.3/etc/php.ini *
    plesk-php53-cgi 5.3.29 5.3.29 cgi /opt/plesk/php/5.3/bin/php-cgi /opt/plesk/php/5.3/bin/php /opt/plesk/php/5.3/etc/php.ini *
  6. Consider adding module and cgi handlers, as well:

    # /usr/local/psa/bin/php_handler --add -displayname 5.3.3 -path /usr/bin/php-cgi -phpini /etc/php.ini -type module -id module
    The new PHP handler with the id "module" was successfully registered.
    # /usr/local/psa/bin/php_handler --add -displayname 5.3.3 -path /usr/bin/php-cgi -phpini /etc/php.ini -type cgi -id cgi
    The new PHP handler with the id "cgi" was successfully registered.
    # /usr/local/psa/admin/bin/php_handlers_control --reread
    # /usr/local/psa/admin/bin/php_handlers_control --list
    id: display name: version: type: cgi-bin: cli-bin: php.ini: system
    module 5.3.3 5.3.3 module /usr/bin/php-cgi /etc/php.ini
    fastcgi 5.3.3 5.3.3 fastcgi /usr/bin/php-cgi /etc/php.ini
    cgi 5.3.3 5.3.3 cgi /usr/bin/php-cgi /etc/php.ini
    ....
  7. If the issue persists, remove files from the /etc/psa/php_versions.d/​ directory and run the following command:
    #v/usr/local/psa/admin/bin/php_handlers_control --reread​
Have more questions? Submit a request
Please sign in to leave a comment.