Eclipse, PDT and XDebug working together at last!
Published by emacstheviking on Sun, 04/24/2011 - 16:15
Just in case this helps anybody else... I have recently reverted to using Eclipse again, my EMACS muscles are tired and want a rest so I thought I would use a more traditional GUI for a while.
For debugging PHP I use XDebug and the Firefox tools to turn it off and on from the icons. My normal debugging tool is Geben, an Emacs extension that is a very very usable and useful debugger, it still worked whilst Eclipse steadfastly refused to do so, the jumped up high-falutin' Java bloated bastard of an application. Sure, yeah, I know, lots of people use it. Lots of people have guns and ammo too but that doesn't make it a good thing. Whatever, not trying to start a flame war.
The Problem
When I hit F11 to start debugging. it didn't. Ever. When I tried to start Geben it complained that port 9000 was in use and that it couldn't bind to it. This indicated to me that the Eclipse code was trying to do its stuff and hogging the default port but for whatever reason it wasn't getting the nod from the request. Here's what I have in my php.ini file:
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.idekey=emacstheviking
The Diagnosis
My gut feeling was that the default 'idekey' set by Eclipse must be wrong so rather than change my working setup (why should ?!) I had a trawl through the various settings in the Eclipse preferences and discovered this on the XDebug configuration page:

Alarm bells ring! Despite it being disabled as I don't use a proxy, I guessed that this value might still be the one being used to trigger the Xdebug plug-in...
The Solution
The solution is simple but, at least to me, non-obvious...
- Enable the proxy option
- Change the idekey value to the right one for your setup
- Disable the proxy option
Once I did that I hit F11 and guess what, it worked.
Not a bad debugger I guess, although Geben is very good, sometimes it's nice to see lots of windows all showing relevant stuff at once without too much mental effort, which is what Eclipse is good at. So is Emacs but you need to write macros and stuff and I can't be bothered these days!
Add new comment