Configuring XDebug on PhpStorm

Configure PHP Remote Debug

Add new

Configure server

Make sure port 9000 is set in PHP Preferences

Gotchas

Port 9000 is busy

Check the log file for Error messags

Log opened at 2016-10-04 21:50:16
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 10.0.0.1:9000.
E: Could not connect to client. :-(
  • Check Port 9000 is setup in PHP preferences. A successful log file should look like:

    Log opened at 2016-10-04 21:49:00 I: Checking remote connect back address. I: Checking header 'HTTP_X_FORWARDED_FOR'. I: Checking header 'REMOTE_ADDR'. I: Remote address found, connecting to 10.0.0.1:9000. I: Connected to client. :-)

Check your client:

 lsof -i tcp:9000

or

netstat -anp tcp | grep 9000