我已经安装了Xdebug,但是在phpinfo()
输出中找不到它。
我正在按照https://xdebug.org/wizard.php进行操作:
量身定制的安装说明 摘要
Xdebug installed: no
Server API: FPM/FastCGI
Windows: no
Zend Server: no
PHP Version: 7.2.14-1
Zend API nr: 320170718
PHP API nr: 20170718
Debug Build: no
Thread Safe Build: no
OPcache Loaded: no
Configuration File Path: /etc/php/7.2/fpm
Configuration File: /etc/php/7.2/fpm/php.ini
Extensions directory: /usr/lib/php/20170718
说明
Download xdebug-2.7.0.tgz
Install the pre-requisites for compiling PHP extensions.
On your Ubuntu system, install them with: apt-get install php-dev autoconf automake
Unpack the downloaded file with tar -xvzf xdebug-2.7.0.tgz
Run: cd xdebug-2.7.0
Run: phpize (See the FAQ if you don't have phpize).
As part of its output it should show:
Configuring for:
...
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
Run: ./configure
Run: make
Run: cp modules/xdebug.so /usr/lib/php/20170718
Edit /etc/php/7.2/fpm/php.ini and add the line
zend_extension = /usr/lib/php/20170718/xdebug.so
Restart the webserver
重新启动php和nginx,它仍然无法正常工作。
当我执行php -m|grep xdebug
时,它返回:
无法加载/usr/lib/php/20180731/xdebug.so:/usr/lib/php/2017/xdebug.so:未定义的符号:zend_post_startup_cb
我不知道zend_post_startup_cb
是什么;我在网站上找不到任何信息。
答案 0 :(得分:3)
尝试从此安装
sudo apt-get install php-xdebug
您可以在此处找到xdebug.ini(适用于php版本7.2)
vi /etc/php/7.2/mods-available/xdebug.ini //zend_extension=xdebug.so
答案 1 :(得分:0)
尝试运行:
sudo pecl install xdebug
并按照其说明进行操作。我已经尝试过多种方式来编译xdebug,而PECL是唯一与之一起使用的