Jeremy Simkins | Web Developer

Sep
29

Setting up MAMP Pro with Zend Debugger, Optimizer and Extension Manager

Filed Under: MAMP, Zend

It seems some are having trouble setting up the Zend Debugger so i wrote this after doing some testing to see why people are having this problem. I provide below how to do this in MAMP Pro. This will also get rid of the :8888 at the end of the url as well.

  1. Download an install the latest version of MAMP
  2. Install MAMP
    • Install MAMP Pro – I recommend this if you work on multiple projects, it is way easier than editing your hosts file and the http.conf every time
    • If you are NOT using MAMP Pro please use this tutorial

MAMP PRO :

  1. Go ahead and make sure that MAMP is working, go to localhost:8888/MAMP and select phpinfo()
  2. Check the powered by image, this is the first image, it should look like this
  3. Go to the MAMP Pro Controller, Select General
    • First lets get ride of the :8888 at the end of the url, Click on the “Default Ports” option (this will get rid of the ports on the end of the url)
    • Select the PHP tab and check Zen Optimizer to use the optimizer – (Optional)
    • select “Apply” and let the server restart, or restart it if it does not automatically
  4. Now go to localhost/MAMP and again select the phpinfo() option. Scroll down to the same image an now you should notice the Extension Manager and the Optimizer set (The Extension Manager will only be on here if you chose to check the optimizer in the step above)

Now We can Setup the Debugger :
Now lets do the supposed hard part, lets turn on the debugger.

  1. Download the latest debugger. You can grab it from here – (i downloaded darwin for my intel based mac book pro)
    • Take the file that was extracted and put it in the MAMP directory -
      /Applications/MAMP/bin/php5/zend/lib/
      (i renamed the unzipped folder to ZendDebugger-5.2.14 so i will be using it through the rest of the tutorial, you can name the file whatever you want)
  2. The edits are the same for both MAMP and MAMP Pro. The only difference is where the files are located for each. I believe this is the area that is causing the confusion on setting up MAMP with the debugger.
  3. The MOST important part of setting up the debugger is the folder structure. you will have to rename the version folder to the correct format.
    • The original folder name is – 5_2_x_comp – you will need to rename it to – php-5.2.x
    • The folder structure should be setup like this

MAMP PRO :

  1. Open the php.ini that is being used by MAMP Pro. Now the problem i had with this was i was using the php.ini from the MAMP Pro directory, that is not the correct one. To get to the correct php.ini you have to be in MAMP Pro and choose File -> Edit Template then the appropriate ini file, i will be using php5.ini since i am using php5.
  2. Open the php.ini and scroll to the bottom of the file it should look something like this
  3. You will want to add after the “MAMP_zend_optimizer_MAMP”

    zend_extension_manager.debug_server=/Applications/MAMP/bin/php5/zend/lib/ZendDebugger-5.2.14
    zend_debugger.allow_hosts=127.0.0.1
    zend_debugger.expose_remotely=always

    • The php.ini should look like this now
  4. Save the file and restart the server
  5. Go to localhost/MAMP and choose phpinfo() and you should now see the debugger in the powered by image.

Now if you did everything correct you will now have the debugger working with your MAMP Install.

Hope this was helpful.

12 Responses to “Setting up MAMP Pro with Zend Debugger, Optimizer and Extension Manager”

  1. nigeljhFebruary 20th, 2009 at 9:53 am

    thanks for the fantastic article ; i am now up and running finally !!

    a quick question though, regarding eclipse if you use it …. eclipse always puts localhost in the domain string when i try to preview/debug, and it doesnt work … if i replace this using my mamp pro local url, then its ok … sure it must be a config somewhere, but damned if i can find it !!

  2. ChordolApril 9th, 2009 at 11:33 am

    Jeremy, this is one of the better tutorials I have ever seen plus luck had it that I have the exact same setup as you.

    You can imagine my frustration when it didn’t work… until I tried it with darwin version of ZendDebugger. If you have a minute to elaborate why is darwin the right choice for intel based mac book pro, I’d be grateful, or in other words wtf does darwin stand for?

    Thank you very much for the time you invested in this post, it filled a big gap in my development environment.

    All the best!

  3. SoN9neApril 12th, 2009 at 5:54 pm

    I have played with the eclipse version but find it more troublesome than it is worth. I’ll just stick to Zend Studio v.5.5.1. There is nothing better than it.. although PHP 5.3 and namespaces are a major drawback for it.

    As for the different debugger types. It is my understanding that:
    cygwin – Is for Windows
    darwin – Is for Mac

    Then the two Linux installs are for 32 and 64 bit Linux systems.

  4. Alex CrookesApril 3rd, 2010 at 3:26 pm

    I had to do some more playing with this

    loading the debugger with the extension manager didn’t work, but it does when I use

    zend_extension=/Applications/MAMP/bin/php5/zend/lib/ZendDebugger-5.2.26/php-5.2.x/ZendDebugger.so

    Of course, you’ll need to replace my path with your own.

  5. SoN9neApril 6th, 2010 at 11:51 am

    You can hard-code the path like that, I use to do it that way before I learned this method. Typically, the cause of it not working is the sub-folder was not renamed to the proper name (php-5.1.x). I’m glad you got it working.

  6. heidivt73April 22nd, 2010 at 5:37 pm

    Figured out after reading this article why setting up debugging was so difficult… the installation guide provided by Zend has incorrect instructions… It says to set zend_extension instead of zend_extension_manager.debug_server, no wonder it wasn’t working!

  7. KentAugust 1st, 2011 at 9:47 pm

    thank you very much!!!!!!!!!!

  8. Patricia HarringtonAugust 9th, 2011 at 1:29 pm

    Thank you for a very helpful post!

  9. BrendonOctober 20th, 2011 at 7:04 pm

    Thank you

  10. Amar DesaiMarch 7th, 2012 at 10:54 pm

    Hi Jermey,

    I am new to software development and I’m trying to setup my development environment. I looked at your post, which is very well written, and I still am having some issues. I have downloaded MAMP PRO v.2.0.5 and downloaded ZendDebugger-20110410 from the Zend website. I followed your instructions explicitely and I still don’t have my debugger setup. This post was written a few years ago, and the Zend Optimozer is not longer supported by MAMP PRO. I am not sure if you still support this site, but I wanted to reach out to see if you had any insight on my problems. I hope to hear from you.

    Thanks,
    ~Amar

  11. SoN9neMarch 9th, 2012 at 9:32 am

    My setup is as follows:

    In your php.ini (use the same method to access it as the tutorial suggests) use this:

    [ZendDebugger]
    zend_extension=/Applications/MAMP/bin/php/php5.2.17/lib/php/extensions/zend/ZendDebugger.so
    zend_debugger.allow_hosts=127.0.0.1
    zend_debugger.expose_remotely=always

    Just make sure that the ZendDebugger.so is in the location specified and it should work just fine.

    You don’t need to worry about the file structure in this tutorial since you are not using Zend Optimizer or the extension manager.

    Let me know if this works for you.

  12. WP AppsMay 6th, 2014 at 8:53 am

    This should do the trick if you are using only the Debugger.

    [Zend]
    zend_extension=/Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212/ZendDebugger.so
    zend_debugger.allow_hosts=127.0.0.1/32,192.168.1.1/16
    zend_debugger.expose_remotely=always
    zend_debugger.allow_tunnel=127.0.0.1/32

    Of course use appropriate path to the ZendDebugger.so

    You need zend Zend Debugger v6.0.0 to get it work. If you download debugger from Zend download page, it will fail.

    Proper Zend debugger is available at Zend Studio, for example:

    /Applications/ZendStudio.app/Contents/Resources/Java/plugins/com.zend.php.debug.debugger.macosx_10.6.0.v20140128-2127/resources/php55/ZendDebugger.so

Leave a Reply

Profile

Jeremy Simkins is an accomplished senior web developer with over ten years in the production field. Experienced PHP developer as well as a passionate software engineer. Jeremy specializes in code optimization, performance, and implementation.

View Jeremy Simkins's profile on LinkedIn

Open Source Projects

MPS Mod

FriendFeed

WordPress

Copyright ©2009 Jeremy Simkins