如何在远程服务器上使用 Xdebug 仅触发我的请求

How to trigger only my requests using Xdebug on remote server

我正在尝试调试远程服务器上的代码。

我正在使用

所以,当

Xdebug 触发每个请求,不仅来自我的浏览器或 PhpStorm,还来自互联网上所有其他用户。

正常吗?

是否可以仅查看从我的 PhpStorm 或我的 Chrome 请求发起的请求?如果是,那么如何设置?

Xdebug triggers to each requests not only from my browser or PhpStorm, but from all other users from the internet.

Is it normal?

这取决于您的 Xdebug 配置。现在看起来它被配置为自动尝试调试每个请求(在许多情况下不是一个好主意)。

Is it possible to watch only requests initiated from my PhpStorm or from my Chrome requests? If yes, so how to setup?

是的,请确保 xdebug.remote_autostart 已关闭(设置为 0/no)。

那么就按照官方的指南:https://www.jetbrains.com/help/phpstorm/debugging-with-phpstorm-ultimate-guide.html

Xdebug 将看到由 Chrome Xdebug Helper(或 GET/POST 参数,如果您在 URL/request 中手动传递它)设置的 Xdebug cookie,并将尝试仅调试那些请求。

P.S。在另一种情况下,上述选项将无济于事。但到目前为止,您似乎没有遇到这种情况(需要查看 更多 详细信息)。