Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created October 16, 2013 08:16
Show Gist options
  • Select an option

  • Save jehoshua02/7004362 to your computer and use it in GitHub Desktop.

Select an option

Save jehoshua02/7004362 to your computer and use it in GitHub Desktop.
Hastle free PHP debugging with !

In the xdebug docs, I found a list of debugging clients!

I chose a standalone called MacGDBp.

I also widdled the xdebug configs down to the bare minimum for hastle free debugging:

zend_extension=/usr/lib/php5/20090626/xdebug.so

xdebug.remote_enable = 1 
xdebug.remote_connect_back = 1
xdebug.remote_autostart = 1

Obviously, remote xdebug ain't gonna work at all unless I remote_enable. The remote_connect_back is an alternative to specifying an ip address. And I hate how most IDEs make the process of starting and stopping debugging sessions so stuffy, so I like remote_autostart. For everything else, I rely on the documented xdebug defaults. All I gotta do is configure the path maps and breakpoints in the client.

I learned how to diagnose connectivity with netcat too:

$ nc -l 9000

This will start listening for debug messages. Hit a url in the application and see the debug message come through. If it don't come through, then check your xdebug settings on the server with this:

$ php -i | grep xdebug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment