简体   繁体   English

netbeans中的xdebug不会绑定到端口9000

[英]xdebug in netbeans won't bind to port 9000

I've been trying to configure xdebug to work along with netbeans, my current configuration is 我一直在尝试配置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"

I tried the test provided by a netbeans blog explaining how to test if the configuration works when binding it just outputs "unable to bind" 我尝试了netbeans博客提供的测试,解释了如何在绑定时测试配置是否有效只输出“无法绑定”

Any suggestions? 有什么建议?

A couple of things off the top of my head... 我脑子里有几件事情......

Firstly, check that nothing else is already listening to port 9000 (on the command line, type netstat -an ). 首先,检查没有其他内容正在侦听端口9000(在命令行上,键入netstat -an)。

If that doesn't show anything, make sure the Windows Firewall is not enabled. 如果没有显示任何内容,请确保未启用Windows防火墙。

This was my Solution for the same issue. 这是我对同一问题的解决方案。

The Configuration of xdebug in the php.ini is minimalized. php.ini中xdebug的配置最小化。

php.ini: 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

Right click Project > Run configuration: 右键单击Project> Run configuration:

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

Tools > Options > PHP > Debugging 工具>选项> PHP>调试

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

The Debugger Port has to be another than the Server Port. 调试器端口必须是服务器端口以外的其他端口。 The Ports defined in netbeans have to match the one defined in php.ini(xdebug-port) and httpd(apache-port) netbeans中定义的Ports必须匹配php.ini(xdebug-port)和httpd(apache-port)中定义的端口

Server: 127.0.0.1:9000
XDebug: 127.0.0.1:9001

Close netbeans and restart the server, open Netbeans and press CTRL+F5 (Run Debug). 关闭netbeans并重新启动服务器,打开Netbeans并按CTRL + F5(运行调试)。

This worked For Ubuntu 16.04, Net beans 8.2 这适用于Ubuntu 16.04,Net beans 8.2

open xdebug.ini (for me it was in /etc/php/{php-version}/mods-available) and put 打开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 -> Tools > Options > PHP > Debugging Net beans - >工具>选项> PHP>调试

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

unchecked all Check-boxes here. 取消选中此处的所有复选框。

My configs were just fine as mentioned above but it wasn't working fine until i unchecked all check-boxes as mentioned by @Beka. 我的配置就像上面提到的那样好,但是在我取消选中@Beka所提到的所有复选框之前它没有正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM