1

我正在使用 Netbeans 来做我的项目(codeigniter),我的 xdebug 是在 php ini 中配置的。以下是设置:

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_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_autostart = 1
xdebug.idekey = "netbeans-xdebug"
xdebug.remote_log="C:\xampp\tmp\xdebug.log"
xdebug.remote_port=9001

php info 显示 xdebug 已激活。我在登录方法中的变量上设置断点并开始调试。出现登录页面的链接:

localhost/goldilock/index.php?XDEBUG_SESSION_START=netbeans-xdebug

登录后,断点未激活,无法调试,链接的 XDEBUG_SESSION_START=netbeans-xdebug 部分消失。

有什么办法可以激活调试。我找不到任何解决方案来激活调试器到断点。

xdebug.log 说明如下:

日志于 2013-07-01 05:40:22 打开
I:连接到配置的地址/端口:127.0.0.1:9000。
E: 无法连接到客户端。:-(
日志于 2013-07-01 05:40:23 关闭

日志于 2013-07-01 05:40:35 打开
I:连接到配置的地址/端口:127.0.0.1:9000。
E: 无法连接到客户端。:-(
日志于 2013-07-01 05:40:36 关闭

日志于 2013-07-01 05:40:38 打开
I:连接到配置的地址/端口:127.0.0.1:9000。
E: 无法连接到客户端。:-(
日志于 2013-07-01 05:40:39 关闭

日志于 2013-07-01 05:40:39 打开
I:连接到配置的地址/端口:127.0.0.1:9000。
E: 无法连接到客户端。:-(
日志于 2013-07-01 05:40:40 关闭
4

2 回答 2

1

这就是我在 Derick 的回答的帮助下所做的:

第 1 步:将 xdebug.remote_port=9000 更改为 xdebug.remote_port=9001

第2步:

  1. 更改 Netbeans 中的调试端口。转到工具>>选项>>单击PHP选项卡
  2. 在 PHP 选项卡下单击调试
  3. 更改调试器端口:9001
  4. 更改会话 ID:netbeans-xdebug

第 3 步:重新启动服务器和 netbeans

第 4 步:设置断点并尝试

于 2013-07-01T06:04:57.013 回答
1

首先,您确实需要打开xdebug.remote_enable=1- 没有它,调试不会被激活并且它不会工作。

对于第一次“登录”之后的请求,xdebug.remote_autostart应该处理它,但 Netbeans 可能不接受新传入的调试连接。要找出 Xdebug 正在尝试做什么,请添加设置xdebug.remote_log=c:\temp\xdebug.log并调查日志中的内容。(您可能必须更改路径)。

于 2013-06-29T20:44:44.957 回答