PHP debugging addendum

In case anybody out there is actually getting PHP tips from me (hint: that’s not a good idea) I should point out that you should be using Xdebug.

My last tip works plenty-fine with it, but additionally it gives you pretty-printed backtraces in the browser. Sort of like Django’s error screen, but not nearly as nice.

Don’t be like me. Don’t spend two years manually emitting backtraces to the system log. In Ubuntu (11.10, at least) getting Xdebug is as simple as:

sudo apt-get install php5-xdebug
sudo service apache2 restart

I’m sure your distro’s package manager is as simple as mine.

  • Paul Feitzinger

    Geben will let you use emacs as an Xdebug client. It’s pretty sweet.