xdebug - 如何使用 xdebug 跟踪我的 curl

标签 xdebug

我曾尝试将 Xdebug 与 sublime 一起使用,它可以工作。我想跟踪我的curl代码,例如:

我打开了一个 URL http://localhost:8001/test/show,我的断点位于 test.php 文件,它可以工作。在 test.php 中,我使用 curl 调用 http://localhost:8002/api/show 并且我想添加断点在 api.php 文件中,但它不适用于 api.php。我该怎么做?谢谢。

最佳答案

尝试将 XDEBUG_SESSION cookie 添加到您的curl 请求中:

curl -i -X POST -d '{"some":"data"}' http://your-local-domain -b XDEBUG_SESSION=PHPSTORM

可选地使用path cookie:

curl --cookie "XDEBUG_SESSION=PHPSTORM;path=/;" localhost

关于xdebug - 如何使用 xdebug 跟踪我的 curl ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33953859/

相关文章:

docker - 使用 Xdebug 作为调试器在 Docker 容器上使用 VSCode 调试 Laravel

php - XDebug 未加载到 PHP(Vista、Apache 模块)中

php - 在 Windows 上将 Xdebug 和 PhpStorm 与 Docker 容器一起使用

phpstorm - 在 PHPUnit 运行期间,Xdebug 在 xdebug_break() 处停止,但不在 PhpStorm 中的断点处停止

php - netbeans 中的 xdebug 不会绑定(bind)到端口 9000

php - 提高 Xdebug 性能

PHPStorm、Xdebug和远程调试(在phpstorm中使用FTP)

php - 是否可以在 php 内置 Web 服务器上使用 xdebug?

php - Xdebug 在 php.ini 生产性能

php - 为什么我不能在 Eclipse 中选择 xdebug 作为 php 调试器