Article ID: 120286, created on Feb 24, 2014, last review on May 10, 2014

  • Applies to:
  • Plesk Automation 11.5

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.

Search Words

incorrect PHP version is choosen by default

33a70544d00d562bbc5b17762c4ed2b3 e0aff7830fa22f92062ee4db78133079 caea8340e2d186a540518d08602aa065

Email subscription for changes to this article
Save as PDF