如何通过内部 HTTP 请求启动 Xdebug?
我使用 SSH 隧道很好地设置了 Xdebug。从命令行连接时,我使用 XDEBUG_CONFIG
环境变量;通过 HTTP 连接时,我使用 XDEBUG_SESSION
cookie。两者都工作得非常出色。
我的问题是我正在从事的项目向内部 API 发出内部 HTTP 请求。由于请求在内部重复,因此它不会继续会话,因此当它来自前端请求时,我无法调试 API 中的任何内容。
有没有办法解决这个问题,以便我可以调试两者?
I have Xdebug set up nicely using an SSH tunnel. When connecting from the command line I use the XDEBUG_CONFIG
environmental variable and when connecting over HTTP I use the XDEBUG_SESSION
cookie. Both work brilliantly.
My issue is that the project I am working on makes internal HTTP requests to an internal API. As the request is repeated internally, it doesn't continue the session and I therefore cannot debug anything in the API when it comes from a front-end request.
Is there a way to fix this so that I can debug both?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
总有 http://xdebug.org/docs/remote#remote_autostart (尝试) 启动远程调试会话。如果仅来自浏览器,您可能需要查看自动添加 cookie 且无需任何用户干扰的浏览器扩展之一: http://xdebug.org/docs/remote#browser-extensions
干杯,
德里克
There is http://xdebug.org/docs/remote#remote_autostart that will always (try to) start a remote debugging session. If it's just from the browser, you might want to look at one of the browser extensions that automatically add a cookie without any user interference: http://xdebug.org/docs/remote#browser-extensions
cheers,
Derick