Xdebug Log Error : Could not connect to client

I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(

You are getting this error because “LISTEN UP” : xdebug expects the client to open port 9000 so it can communicate with it. So it it the other way around (SMH)…
You probably expected the server to have port 9000 open don’t ya. Nops!!! The client is the one that needs to have port 9000 opened.

So if you are using Netbeans as an example and you are using a remote server for your PHP files, you need to follow these steps :

First  : 
Open up port 9000 on your client machine (Windows or Linux Firewall)

Second :  
Make sure you can telnet your client on port 9000 or whichever
port you choose FROM THE SERVER.

third : 
Configure the server to talk to the client. Lets say your client 
IP is Change the Xdebug settings to the followings:

xdebug.auto_trace = 1
xdebug.remote_host=  ; This is the client IP

Configure your netbeans so the server can communicate with it:


Fifth: Test it. Happy debugging!!!