xdebug.so: undefined symbol: zend_ce_error

2020-07-23 05:47发布

问题:

I need debug old php version:

PHP 5.6.22 (cli) (built: Jun 29 2016 14:26:09)   
Copyright (c) 1997-2016 The PHP Group  
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

On Ubuntu: Ubuntu 16.04 LTS

I compiled appropriate PHP, and checked out xdebug from git repository:
git://github.com/xdebug/xdebug.git

I tried different versions, but just master seems compiling.
In my errors I have:

Failed loading /usr/share/php53/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so:  /usr/share/php53/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so: undefined symbol: zend_ce_error

I know that it is new version of xdebug with too old version of PHP.
If I try compile for instance xdebug 1_0, I have:

Makefile:181: recipe for target 'xdebug.lo' failed

With other versions I have other errors.

My basic question is: how I can find appropriate xdebug for PHP 5?

UPDATE

  1. xdebug.org/download.php - in terms of different versions, it contains just Windows binaries
  2. sudo apt-get install php5-xdebug - will not work on Ubuntu 16.04 because it doesn't supports php5
  3. pecl install xdebug - in best case will compile last version that I already have, in worst will fail (it happened to me, I tried), because same reason mentioned above.

回答1:

I had the same error on CentOS, also compiling from github. The solution for me was to copy and paste my phpfino into the wizard https://xdebug.org/wizard.php and follow the instructions exactly.

In my particular case it seems that the answer was to be found in http://xdebug.org/files/xdebug-2.4.1.tgz as using that instead of the latest github version means apache can load it and it now shows on my phpinfo page