If you have issues with netbeans and xdebug not connecting on recent distros, you might find that netbeans is listening on tcp6 and xdebug connecting on plain tcp.
To check if this is the case, run the following command whilst netbeans is “waiting for connection” (change 9000 if you’ve set a different port) :-
netstat -aln | grep 9000
if you get a line similar to the following (specifically tcp6 and not just tcp), it may well be that xdebug can’t connect over ipv6 :-
tcp6 0 0 :::9000 :::* LISTEN
One solution is to disable ipv6, which can be done by creating the file /etc/sysctl.d/10-disable-ipv6.conf with the following contents :-
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
then run (as root or sudo)
sysctl -p /etc/sysctl.d/10-disable-ipv6.conf
and restart netbeans. Suddenly, netbeans will listen on tcp (ipv4) and xdebug will connect.

Hi thanks for this advice. Unfortunately, despite successfully switching netbeans from tcp6 to tcp I still have the original “Waiting for connection” problem.
Hi Mike
Unfortunately there isn’t much else we can suggest – have you tried running netstat to see what is happening?
Bear in mind we are running Linux desktops here so the above advice only applies when using Linux (or similar)
Same here, still have the original “Waiting for connection” problem. Followed the instruction step by step and restart NetBeans.
netstat shows:
tcp 0 0 0.0.0.0:9000 0.0.0.0:* LISTEN
Ubuntu 12.04
After that, re-install Xdebug then restart apache2 finally fixed my “Waiting for connection” problem!
sudo pecl install xdebug
sudo /etc/init.d/apache2 restart
Thanks a lot!