3

我一直在尝试将 xdebug 配置为与 netbeans 一起工作,我当前的配置是

[xdebug]
zend_extension="C:\binaries\php\ext\php_xdebug-2.1.0RC1-5.3-vc6.dll"
xdebug.remote_enable=on 
xdebug.remote_handler=dbgp 
xdebug.remote_host=127.0.0.1 (also tried localhost)
xdebug.remote_port=9000 
xdebug.idekey="netbeans-xdebug"

我尝试了 netbeans 博客提供的测试,解释了如何在绑定时测试配置是否有效,它只是输出“无法绑定”

有什么建议么?

4

3 回答 3

2

有几件事在我脑海中浮现...

首先,检查是否没有其他东西已经在监听端口 9000(在命令行上,输入 netstat -an )。

如果没有显示任何内容,请确保未启用 Windows 防火墙。

于 2010-06-29T12:55:28.153 回答
2

这是我针对同一问题的解决方案。

php.ini 中的 xdebug 配置被最小化。

php.ini:

[XDebug]
zend_extension = C:\Bitnami\wampstack-5.6.21-2\php\ext\php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_autostart=0
xdebug.remote_connect_back=0

右键单击项目 > 运行配置:

Project URL: http://127.0.0.1:9000/<ProjectName>/
Index File: index.php

工具 > 选项 > PHP > 调试

Debugger Port: 9001
Session ID: netbeans-xdebug
Maximum Data Length: 2048
uncheck all Checkboxes

调试器端口必须与服务器端口不同。netbeans 中定义的端口必须与 php.ini(xdebug-port) 和 httpd(apache-port) 中定义的端口相匹配

Server: 127.0.0.1:9000
XDebug: 127.0.0.1:9001

关闭 netbeans 并重新启动服务器,打开 Netbeans 并按 CTRL+F5(运行调试)。

于 2016-06-30T13:52:40.530 回答
0

这适用于 Ubuntu 16.04,Net beans 8.2

打开 xdebug.ini(对我来说它在 /etc/php/{php-version}/mods-available 中)并放入

zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000

Net beans -> 工具 > 选项 > PHP > 调试

Debugger Port: 9000
Session ID: netbeans-xdebug
Maximum Data Length: 2048

取消选中此处的所有复选框。

如上所述,我的配置很好,但在我取消选中@Beka 提到的所有复选框之前它无法正常工作。

于 2017-01-25T09:35:24.083 回答