Default PHP version is missing in the handlesrs list

Created:

2016-11-16 12:54:43 UTC

Modified:

2017-08-08 13:32:46 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Default PHP version is missing in the handlesrs list

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

Default PHP version is missing in the handlesrs list:

# /usr/local/psa/bin/php_handler --list -service-node 10.10.0.45
id: display name: version: type: cgi-bin: php.ini:
module 5.4 5.4 module /usr/bin/php-cgi /etc/php.ini

where 10.10.0.45 is service node IP address.

Cause

PHP binary file /usr/bin/php-cgi was replaced with script which did not work properly:

#/usr/bin/php-cgi -v 
dirname: operand is missing

As a result handler registration failed with error:

# /usr/local/psa/bin/php_handler --reread -service-node 10.10.0.45
ERR (3) [panel]: [Warning] removing handler `5.3.3' (module) due to errors in getting php version : Unable to parse php version : Content-type: text/html

Resolution

  1. Replace PHP binary /usr/bin/php-cgi with the original one, make sure that its version can be obtaion withour error, use echo command to get exit code:

    # /usr/bin/php-cgi -v
    PHP 5.3.3 (cgi-fcgi) (built: Dec 11 2013 03:28:11)
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.

    # echo $?
    0
  2. Backup your current /etc/psa/php_versions.json configuration file, and replace it with the default one (see below), change PHP version according to the outptut from step 2 if needed:

    # cp /etc/psa/php_versions.json /etc/psa/php_versions.json.backup

    Remove everething from /etc/psa/php_versions.json and add the following:

    {"php":[
    {
    "id":"module",
    "path":"/usr/bin/php-cgi",
    "phpini":"/etc/php.ini",
    "version":"5.3.3",
    "displayname":"5.3.3",
    "type":"module"
    },
    {
    "id":"cgi",
    "path":"/usr/bin/php-cgi",
    "phpini":"/etc/php.ini",
    "version":"5.3.3",
    "displayname":"5.3.3",
    "type":"cgi"
    },
    {
    "id":"fastcgi",
    "path":"/usr/bin/php-cgi",
    "phpini":"/etc/php.ini",
    "version":"5.3.3",
    "displayname":"5.3",
    "type":"fastcgi"
    }
    ]}
  3. Reread PHP handlers configuration, run the following command from the Management Node:

    #/usr/local/psa/bin/php_handler --reread -service-node 10.10.0.45
  4. Re-register custom handlers if any using our documnetation.

Have more questions? Submit a request
Please sign in to leave a comment.