Tip for XDebug on Ubuntu 8.10 with Eclipse PDT

After you've got PHP5 and Apache running on your Ubuntu development server, the next thing you'll want is Eclipse PDT. Shortly after that you'll need a debugger.

On Ubuntu 8.10, I set up Eclipse 3.4 (Ganymede) with the latest Release Candidate of PDT 2, it took forever because of some slow mirrors, but I'd recommend just buckling down and getting through it. Here's the step-by-step guide I found most useful. If Ubuntu someday gets PDT and Eclipse 3.4 in the repositories then just use that.

So on to the debugger. I use XDebug and Eclipse together. What got it working in the end was to just install the php5-xdebug package via Synaptic package manager then go tweak the PHP settings. The package will create /etc/php5/apache2/conf.d/xdebug.ini. This has just one line in it needed to tell PHP to load xdebug. Add these lines to let XDebug and Eclipse communicate.

xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1

Some of these are defaults that Eclipse matches anyways, the important bit is really the remote_enable=true. Otherwise you might see some lines like
Dec 20 12:34:20 copper apache2: PHP Stack trace:

in /var/log/messages but Eclipse will sit there and just say "Launching Debugger" forever.

I messed around a long time before I realized I'd missed those lines when reading my own guide to Xampp, Eclipse PDT and XDebug for Windows. That guide covers how to test that the debugger's working with Eclipse - it's about the same for Ubuntu as it was for Windows.

2.588235
Your rating: None Average: 2.6 (17 votes)