介绍
这是新的一年,因此在重建开发环境Docker之后,我无法逐步使用xdebug。
当我查找它时,这是因为在xdebug的版本3中更改了设置项目名称,因此先前的设置无效。
TL; DR
使用以下设置。
顺便说一句,调试器的备用端口(IDE = phpstorm,vscode)必须设置为9003。
1 2 3 4 5 6 7 | xdebug.log=/tmp/xdebug.log xdebug.mode=develop, debug xdebug.start_with_request=yes xdebug.client_host=host.docker.internal xdebug.client_port=9003 zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so |
v2时代设定
也许您可以在Internet上找到这些设置。这是版本2之前的设置。
1 2 3 4 5 6 7 8 | xdebug.remote_enable=1 xdebug.remote_autostart=1 xdebug.remote_port=9003 xdebug.remote_host="host.docker.internal" xdebug.remote_connect_back = 0 xdebug.remote_log=/tmp/xdebug.log zend_extension=xdebug.so |
如何检查xdebug的版本
如果
1 2 3 4 5 6 | root@57b67435355c:/# php -v Cannot load Xdebug - it was already loaded PHP 7.2.33 (cli) (built: Sep 10 2020 15:18:34) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans |
操作检查(phpstorm)
由于使用了
phpstorm,因此有必要检查xdebug的操作。
下图中箭头所示的调试端口最初写为
在
图像中,警告
参考文献
- https://xdebug.org/
我认为这是官方网站。 .. .. ..