xdebug on MacBook Pro

I've successfully added several PHP extensions to my stock, Apple-supplied PHP install on my MacBook Pro. Tonight I wanted to add xdebug to help track down some Drupal OpenID problems. A bit of Google searching and I found a number of examples. Virtually all of them pointed at ActiveState's precompiled xdebug.so binaries, so I tried that.

Command-line (php -m) and (php -i) worked fine after getting my php.ini file correct. But my Apache module never saw the xdebug extension, and that's where I needed it most.

After much thrashing around, I found a blog where my Apache error message --

Failed loading /usr/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so:  (null)

-- was mentioned. The author mentioned recompiling xdebug from source and then meeting with success.

I did the same, and it worked. Apparently on the MacBook Pro, mod-php won't work with the pre-compiled xdebug binary, even thought the command line php will.

Lesson learned.

Fortunately, compiling xdebug was easy and clean. I'm always hesitant to compile things which are full of gotchas, errors and want to drop files all over your filesystem.


I'll be curious to see how

I'll be curious to see how you use it. I just got it running the other day myself and have tinkered with MacGDBp a bit, but haven't gone full-bore yet. I would love an Xcode-style debugging environment with breakpoints by clicking in the editor gutter instead of having to call a function.

I'll keep you posted, too.

Yup, I intend to give

Yup, I intend to give MacGDBp a try as well. I'm actually trying to debug 2 PHP applications talking to each other and a browser -- aka OpenID -- so it might be challenging to make that work all on one box.

It works, mostly

I managed to get MacGDBp working with xdebug on my Mac. You can set breakpoints by clicking in the left gutter with line numbers when the file you want to breakpoint is displayed. There is some flakiness both in getting files displayed, and worse after some number of breakpoint/step sesssion. Usually, I have to quit and relaunch MacGDBp to get it to work again.

It's very simple and primitive, but is still quite helpful in certain circumstances.