Articles :: View

NetBeans XDebug remote waiting for connection

If you are using Windows and Putty you can use this method to create a tunnel and set your remote port to localhost!

See this article: http://derickrethans.nl/debugging-with-xdebug-and-firewalls.html

Other Methods:

sudo vi /etc/php.d/xdebug.ini

; Path to xdebug.so
zend_extension = /usr/lib64/php/modules/xdebug.so

; Recommended settings:
xdebug.remote_enable=on
xdebug.remote_handler=dbgp

; Set the host to your local IP address, the remote server will try to connect back to this host to send it xdebug responses
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"

; These adjust the truncating limits of the var_dump data
xdebug.var_display_max_children=-1
xdebug.var_display_max_data=-1
xdebug.var_display.max_depth=-1

sudo service httpd restart

If you get the message below, make sure your NetBeans IDE is configured with the same port as you set on the server!

Common Issues and Resolutions:

"Waiting for Connection (netbeans-xdebug)"
  1. PHP XDebug configuration
    • remote_host
    • remote_port
  2. Apache needs to be restarted to make php changes take effect
  3. Local Firewall is blocking communication from server to remote_port
  4. Server and Client port/session configuration mismatch

Symptom: Webpage hangs at Loading

Cause: Remote server cannot communicate with local IDE

Troubleshooting:

[remote@server]$ netstat-nap | grep 9000

tcp        0      1 x.x.x.x:54603         y.y.y.y:9000         SYN_SENT 

The SYN_SENT means the server cannot establish a connection to the IDE.


Comments

Add a comment!