allenskd
allenskd

Reputation: 1805

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]
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"

Any suggestions?

Upvotes: 3

Views: 5381

Answers (3)

Hammad Hassan
Hammad Hassan

Reputation: 54

This worked For Ubuntu 16.04, Net beans 8.2

open xdebug.ini (for me it was in /etc/php/{php-version}/mods-available) and put

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

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.

Upvotes: 0

Beka
Beka

Reputation: 343

This was my Solution for the same issue.

The Configuration of xdebug in the php.ini is minimalized.

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 URL: http://127.0.0.1:9000/<ProjectName>/
Index File: index.php

Tools > Options > PHP > Debugging

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)

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).

Upvotes: 2

Narcissus
Narcissus

Reputation: 3194

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 ).

If that doesn't show anything, make sure the Windows Firewall is not enabled.

Upvotes: 2

Related Questions