在CentOS7上安装Xdebug,我得到错误未定义的符号:compiler_globals

I define the xdebug.so path on php.ini.

but I can't see xdebug info in phpinfo() function.

and error comps up like below.

Failed loading /usr/lib64/php/modules/xdebug.so: /usr/lib64/php/modules/xdebug.so: undefined symbol: compiler_globals

How can I resolve this issue?

Using php 7.1.4 version.

Make sure that Xdebug is compiled using right php-config.

Manually download xdebug.tgz from https://xdebug.org/download.php and then follow the instructions on https://xdebug.org/wizard.php.

Just make sure that:

  1. When you do the phpize step - you use the right phpize binary for your PHP installation. If it is a custom installation it will usually be something like /usr/local/php/bin/phpize
  2. Same goes for running the ./configure step. Provide the path to correct php-config binary like this: ./configure --with-php-config=/usr/local/php/bin/php-config

Only then you can complie the extension and copy the xdebug.so file to extension directory. Also remember to make clean first if u compiled that directory at least once before.