Debugging PHP with free tools (PDT + XDebug2)

One very important part of an IDE is the ability to debug the code you write. For web-application development you mostly need remote-debugging facilities. It’s no problem to find a good IDE offering all that for Java web-development. There’s Eclipse and it provides all sorts of features that make a developer’s life easier. For PHP development it’s much harder to find a free IDE that provides good (remote-)debugging features. There’s Zend Studio and Komodo but both aren’t free software. You get Zend Studio for about 350 EUR (~480 USD) and Komodo for 295 USD. For students Zend Studio is 25% cheaper and Komodo is 49 USD. Not free at all, isn’t it?

Approx. one year ago I tried to get a remote-debugging environment using PHPEclipse together with DBG. That was a PITA to set up and once it worked it was just awfully unstable. I figured out that the PHPEclipse people were developing a plugin to use XDebug but there didn’t seem to be much progress. So I stopped my efforts on free remote-debugging. :( Some weeks ago XDebug2 was released and I decided to give the remote-debugging thing one more shot. I tried PDT + XDebug2 and guess what – it worked out fine!

First of all you need a PHP installation with XDebug2. If you don’t have it installed yet (shame on you ;-) ), you can find instructions here. Your next step should be getting PDT. I tried the latest integration build. Additionally you need some plugins for XDebug-support that are only available from the PDT bugzilla:

Once you have all that installed you can create a PHP-project in your PDT-eclipse and configure the environment (XDebug2 and PDT) for debugging. Daniel Holmström published a really good guide on how to install and set up everything in detail. If you follow his instructions you should have everything up and running within half an hour. After that you will be able to enjoy local- and remote-debugging of your PHP-scripts.

Posted in Development, Featured articles, PHP, Fri, 3/08/07

16 Responses



Leave a Reply