如何通过内部 HTTP 请求启动 Xdebug?

发布于 2024-12-06 10:34:49 字数 260 浏览 5 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

东北女汉子 2024-12-13 10:34:49

总有 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文