Why Doesn’t XDebug Work? It Used To.

I found myself asking (again) why XDebug wasn’t working, after installing a new IDE. I’d set a breakpoint, debug the page, but never see the code stop.

I had trouble getting it to run the last time I tried a new IDE, but I didn’t remember exactly what the problem was. This blog post is to remind me how to quickly get XDebug up and running correctly in a new IDE.

Short answer this time: XDebug is usually attached to port 9000. (You set this in your php.ini file.) If it isn’t, or if something else is attached to that port, you can move it, but you have to change both the php.ini file and your IDE’s configuration for where it expects to find XDebug.

This StackOverflow question got me thinking in the right way.

This flowchart from Netbeans also helped me. It pointed me to the excellent tool published by the XDebug folks.

And now that I’ve made a note of how to get myself back up and running in the future, I’m going to make a small donation to XDebug because I do indeed find it useful.

Advertisements
This entry was posted in Debugging, PHP and tagged , , , , . Bookmark the permalink.

2 Responses to Why Doesn’t XDebug Work? It Used To.

  1. Martin Mapes says:

    If you follow the instructions on the “Excellent Tool” while on a Mac, you will need to get around the new Mac protections. Instead of copying to /usr/lib, copy to /usr/local/lib and repoint your files

    http://stackoverflow.com/questions/32659348/operation-not-permitted-when-on-root-el-capitan-rootless-disabled

  2. Martin Mapes says:

    Also, the “Excellent Tool” told me to paste several lines of configuration into my php.ini. I assumed these had not changed since my last install, but somehow I was actually missing xdebug.remote_enable and a few others. In short, it pays to just follow all of the instructions, even if you think some of them might already be done or not apply.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s