在代码中启动 xdebug?
我知道启动Xdebug的这些方法:
?XDEBUG_SESSION_START=name
in url
xdebug.remote_autostart=On
in php.ini
-dxdebug.remote_autostart=On
作为 PHP 二进制调用的参数
,但我不知道如何在代码内启动 xdebug,是否有像 xdebug_start()
这样的函数和xdebug_stop()
?
I know these ways of starting Xdebug:
?XDEBUG_SESSION_START=name
in url
xdebug.remote_autostart=On
in php.ini
-dxdebug.remote_autostart=On
as parameter to the PHP binary call
but I do not know how to start xdebug inside code, is there any function like xdebug_start()
and xdebug_stop()
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为了在 PHP 代码中的其他位置开始调试,您需要在
php.ini
中设置xdebug.remote_mode=jit
。然后,当您调用 xdebug_break 时,调试会话将启动。In order to start the debugging somewhere else in your PHP code than at the start, you need to set
xdebug.remote_mode=jit
inphp.ini
. Then when you callxdebug_break
the debugging session will start.http://xdebug.org/docs/all_functions
同样来自手册:
xdebug_start_code_coverage
、xdebug_get_code_coverage
http://xdebug.org/docs/all_functions
Also from the manual:
xdebug_start_code_coverage
,xdebug_get_code_coverage
这是一个 ini 设置,因此您可以执行以下操作:
It's an ini setting so you can do: