SlashGeek

The online journal of Rebecca Janine Wise

Mac PHP Debugging using Eclipse PDT and MAMP

June28

This took a while to figure out so I’m posting the steps to get this setup working here for future reference. This is a simplified version of the more extensive instructions that can be found here tailored for a typical Mac OSX 1.5+ install.

1. Download and install MAMP here
2. Download and install Eclipse PDT All-In-One here
3. Download and extract the Zend debugger extension binary here
4. Copy the appropriate ZendDebugger.so file to the MAMP install’s PHP extension directory. To determine the appropriate ZendDebugger.so file execute the following PHP code snippet and look for the PHP version number at the top of the page. To locate the extension directory look for the line beginning “extension_dir”
5. Copy the dummy.php file extracted from the archive to your PHP project’s home directory.
6. Find and open the MAMP php.ini file. To find this file you can again look at the page generated by the phpinfo statement in step 4 and look for the line beginning “Configuration File (php.ini) Path”
7. In the php.ini file add or update the following directives:

implicit_flush = On
output_buffering = Off
eaccelerator.enable=”0″

;zend_extension=/usr/lib/php4/20020429/xdebug.so (comment out this directive if it exists)
;extension=dbg.so (comment out this directive if it exists)
;extension=php_dbg.dll (comment out this directive if it exists)

[Zend]
zend_extension=/Path/To/ZendDebugger.so
zend_debugger.allow_hosts=127.0.0.1/32
zend_debugger.expose_remotely=always

8. Remove all other directives from the [Zend] section of the php.ini file

That’s it! If I forgot something drop me a comment!


 
posted under No Category
10 Comments to

“Mac PHP Debugging using Eclipse PDT and MAMP”

  1. On June 30th, 2008 at 11:20 pm Suzanne Says:

    Duh! Any child knows you’re going to have to download the zend debugger extension in the binary php files in order to flush the manp eaccelerators. Come on!

    Yeah, that ought to work, I think. Back when I knew how to use computers, we didn’t have these fancy directives and zend extensions and stuff. We had to do all of this with 1s and 0s, and you had to use the 1s sparingly because they used more electricity. I once wrote an entire C compiler using nothing but 0s, just to show off.

    Thanks for posting this. I’ll keep it in mind if I ever have to do whatever the hell it was. (It’s not something to do with being transsexual, is it? If it is, I’m giving up and going back to being a guy, by the way.)

  2. On September 17th, 2008 at 10:00 pm James Says:

    Hi, I found your blog on this new directory of WordPress Blogs at blackhatbootcamp.com/listofwordpressblogs. I dont know how your blog came up, must have been a typo, i duno. Anyways, I just clicked it and here I am. Your blog looks good. Have a nice day. James.

  3. On November 30th, 2008 at 3:20 pm (apple)mac geek » Installing, integrating and configuring Eclipse for Drupal on a Mac Says:

    [...] This is condensed from Using PDT : Installation : Installing the Zend Debugger and Mac PHP Debugging using Eclipse PDT and MAMP. [...]

  4. On December 20th, 2008 at 11:29 pm shodan Says:

    Thank you! I flailed for a day trying different solutions for getting php debugging with eclipse to work on my Mac.

    Well done.

  5. On January 15th, 2009 at 2:45 pm Tom Says:

    To run Zend Optimizer and Debugger at the same time, see instructions here:http://blog.tigeryao.com/2008/how-to-allow-zend-optimizer-and-zend-debugger-coexist.html

  6. On February 7th, 2009 at 4:53 am Sotiris Says:

    Thank you very much!

  7. On April 14th, 2009 at 3:29 pm Configurare MAMP (non Pro) per Zend Debugger PHP in Eclipse PDT (e simili) « Macgix’s Weblog Says:

    [...] Ringraziate anche: http://slashgeek.com/?p=341 [...]

  8. On July 19th, 2009 at 11:35 am rolf Says:

    I use Codelobster on Windows.
    It is not as prestigious as Eclipse, but its not a 100+ meg download, it works, has code hints based on your own classes and a good debugger in my opinion.
    I tried eclipse, I spent hours trying to get the debugger to work, it just didnt and gave me cryptic error messages. Plus I am against downloading a 120 megabytes ide with tons of (in my opinion) useless configuration options… I just dont like Eclipse. Its personal… feel free to use it. I guess eclipse comes from the java world, and has that java philosphy of complexity.

  9. On August 5th, 2009 at 8:28 am Zashkaser Says:

    Your blog was of course amazing again even though it was terrifying for me to read what happened to you.You turned what could have been a very bad thing into something funny and positive. Do take care. Also your live radio news broadcast was also amazing.I love you xoxox

  10. On October 22nd, 2009 at 10:10 am Auto Delovi Says:

    has been long time since I used Eclipse 4 years ago .. and it took me one whole day to get PHP and Debugger working , but it was worth it … though I did not like Editing features those days as Zend Studio had really nice shortcuts … so I felt same way going back from Mac to Windows :) Though I’ll try new version as PDT was not available at that time.
    Cheers

Email will not be published

Website example

Your Comment: