>Typically when working on PHP files I don’t have much of a need to setup a debugger. However, I’ve recently had to go through some really nasty PHP 4 code. It was one big massive mess of nested if then else statements no functions, and a crap load of global variables. PHP is a good utility language, but some of the people writing the code need to read Uncle Bob’s Clean Code book.
My development machine is a Ubuntu box and I have eclipse Galileo Java EE package installed with PDT 2.1 added as well. There is a decent blog entry at Hodge title
Debugging PHP Applications with Xdebug and Eclipse PDT. However you can simplify some of the steps.
- Use apt-get or Synaptic to install apache2, php5, php5-cli, and the php5-xdebug module.
- Go to the terminal and restart apache2:
sudo /etc/init.d/apache2 restart
- Follow the rest of the steps outline in Hodge’s article for making sure XDeubg is turned on and enabled.
There is no need to download and compile xdebug yourself, as it’s already in the Ubuntu apt repository. If you follow the rest of his steps for setting up PDT for XDebug, you should be ready to debug.