Unable to register the PHP handler: can not get version from /usr/bin/php-cgi

Created:

2016-11-16 12:58:16 UTC

Modified:

2017-04-24 12:01:41 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to register the PHP handler: can not get version from /usr/bin/php-cgi

Applicable to:

  • Plesk 10.4 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

  1. During the attempt to add a PHP handler you get:

    Unable to register the PHP handler: can not get version from /usr/bin/php-cgi
  2. PHP fails with the " Segmentation fault " error:

    ~# php -v
    PHP 5.3.3-7+squeeze17 with Suhosin-Patch (cli) (built: Aug 23 2013 15:06:16)
    Copyright (c) 1997-2009 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., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
    Segmentation fault

Cause

PHP installation might be corrupted.

Resolution

  1. Use the " strace " command to see what files are opened by the " php " process before it fails:

    ~# strace -vts4096 -ostrace.log php -v

    After strace finishes, check the strace.log file from the bottom up and check what files were opened before the error. It is highly possible that some included module causes an issue.

  2. Another way to debug the php process is by using the GNU Debugger ( gdb ):

    1. If no gdb is installed on the server, install it using one of the following commands:

      • CentOS/RedHat: yum install gdb
      • Debian/Ubuntu: apt-get install gdb
    2. Enable core dumps in the shell session:

      ~# ulimit -c unlimited
    3. Run the php command again to generate a core dump file:

      ~# php -v
      PHP 5.3.3-7+squeeze17 with Suhosin-Patch (cli) (built: Aug 23 2013 15:06:16)
      Copyright (c) 1997-2009 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., and
      with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
      Segmentation fault (core dumped)
    4. Open core file in GDB:

      ~# gdb `which php` core
      Program terminated with signal 11, Segmentation fault.
      #0 0x00007fa57086d617 in ?? ()
    5. Check the core file's back trace, which can give you a clue as to which library and function are involved in the failure:

      (gdb) bt
      #0 0x00007fa57086d617 in ?? ()
      #1 0x0000000000d45600 in ?? ()
      #2 0x000000000068953f in ?? ()
      #3 0x0000000000690362 in ?? ()
      #4 0x00000000006905e8 in zend_hash_graceful_reverse_destroy ()
      #5 0x0000000000684285 in ?? ()
      #6 0x000000000062ecdd in php_module_shutdown ()
      #7 0x00000000007134e0 in ?? ()
      #8 0x00007fa57774cc8d in __libc_start_main () from /lib/libc.so.6
      #9 0x000000000042d6e9 in _start ()

    In the above example the issue was with Zend extension, which is clear from the back trace.

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