How to Configure Eclipse PDT with Zend Server Debugger on MAMP for Drupal

Anything involving Eclipse is always epic. First, you have to get your head around what distribution of it to use, as confusing as one's first introduction to Linux distributions (there are different kinds of Linux?).

Next, you have to grok the fact that the Zend Debugger must be installed on your server. In this case, MAMP.

Then, you have to make Eclipse listen to the debugging information being outputted, on the debug port.

Finally, you have to figure out how to use a debugger effectively (not in scope, but careful, debugging will blow your mind).

I started with this screencast, lulled by his easy manner of speech. The directories in MAMP are slightly different, like 5.2 and 5.3 instead of whatever he said. Not a big deal, just noting it.

Great! I hit "Test Debug" and...

Test Debug Server: Web server connection failed. Please verify that the address ....

So then I went to:
Eclipse -> Preferences -> Debug -> Installed Deguggers

And change the Zend debug port to whatever the output of your phpinfo gives you, which in my case was 65535.

I knew something was happening at that port because
telnet 127.0.0.1 65535
and typing some random stuff produced errors with the word "debugger" in it (thanks for the tip, Dan).

But it turns out the real problem was that there was a superfluous
zend_extension = "/Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613/xcache.so"

in my php.ini file. Anyone else notice that these config files get kinda crufty even without touching them?

Commented it out and now I get a happy:

Test Debug Server: Success!

Thanks much to Rebecca Janine Wise for her excellent post with configuration errata. Definitely worth a read if you are configuring Eclipse PDT.

Comments

rfay's picture

It looks like maybe you already cleaned up http://drupal.org/node/157609 a bit, but could you take a look and make sure it works on the mac? I try to keep up with it on Ubuntu and Windows, but it can get away anyway. If you could update the PHP 5.3 stuff it would be appreciated. Note that Zend PHP 5.3 downloads are listed at http://randyfay.com/node/68.

Thanks,
-Randy

dalin's picture

Anything involving Eclipse is always epic.

I suggest checking out Netbeans. I find it to be a faaaaaar more usable IDE.

Paige Cook's picture

This was exactly the issue I was experiencing. Once I found the additional zend_extension entry and removed it, I was able to verify my Zend Debugger settings via the phpinfo() page.

Thanks