我曾尝试将 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/