在CentOS7上安装Xdebug,我得到错误undefined symbol:compiler_globals
问题描述:
我在php.ini中定义了xdebug.so路径。在CentOS7上安装Xdebug,我得到错误undefined symbol:compiler_globals
但我无法在phpinfo()函数中看到xdebug信息。
和错误如下所示。
无法载入/usr/lib64/php/modules/xdebug.so:/usr/lib64/php/modules/xdebug.so:未定义的符号:compiler_globals
我怎样才能解决这个问题?
使用php 7.1.4版本。
答
确保使用正确的php-config
编译Xdebug。
手动从https://xdebug.org/download.php下载xdebug.tgz
,然后按照https://xdebug.org/wizard.php上的说明进行操作。
只要确保:
- 当你做对
phpize
一步 - 你使用了正确phpize
二进制PHP安装。如果是自定义安装,则通常类似/usr/local/php/bin/phpize
- 同样可以运行
./configure
步骤。提供路径纠正php-config
二进制这样的:./configure --with-php-config=/usr/local/php/bin/php-config
只有这样,你可以complie扩展性和xdebug.so
文件复制到扩展目录中。如果你之前至少编译过一次该目录,请记住make clean
。