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