PHP Netbeans断点仅针对来自调试会话启动的浏览器的请求

时间:2015-01-24 21:56:52

标签: php codeigniter netbeans xdebug

我正在调试一个PHP codeigniter项目,其中有一个控制器方法来读取php://input并从中获取数据。如果我通过浏览器请求方法(由netbeans调试启动),我在那里放了一个断点,它会成功命中。我有另一个JAVA应用程序,它将数据发送到同一个方法。我需要的是抓住它。但是netbeans断点没有受到java应用程序发起的请求的影响。无论如何我能实现这个吗?提前谢谢。

zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_mode = "req"
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "C:\xampp\tmp"

1 个答案:

答案 0 :(得分:1)

经过一些研究和调整,我能够配置它。首先,您需要添加

xdebug.remote_autostart = 1
xdebug.idekey = "netbeans-xdebug"

到php.ini自动启动没有XDEBUG_SESSION_START=netbeans-xdebug的调试会话,Netbeans默认只监听上面的ide键。

然后您应该启用“不在项目属性中打开Web浏览器 - >运行配置 - >预先。我不需要路径映射(我启用了将文件复制到服务器的选项)。现在断点应该达到任何来源发起的请求(对我来说是Firefox,Chrome和我的Java应用程序)。

参考:

Stackoverflow Question

Xdebug docs

相关问题