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.
- Download an install the latest version of MAMP
- 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
Setup MAMP Pro:
- Go ahead and make sure that MAMP is working, go to http://localhost:8888/MAMP and select phpinfo()
- Check the powered by image, this is the first image, it should look like this
- 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)
Will now become: - Select the PHP tab and check Zen Optimizer to use the optimizer – (Optional)
Will now become: - Select “Apply” and let the server restart, or restart it if it does not automatically
- First lets get ride of the
- Now go to http://localhost:8888/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 hard part… turn on the debugger.
- 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) - It is also stated that it can be found in Zend Studio.
- Located:
/Applications/ZendStudio.app/Contents/Resources/Java/plugins/com.zend.php.debug.debugger.macosx_10.6.0.v20140128-2127/resources/php55/ZendDebugger.so
- Located:
- Take the file that was extracted and put it in the MAMP directory –
- 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.
- 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
Configure MAMP Pro:
- 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.
- Open the php.ini and scroll to the bottom of the file it should look something like this
- After:
MAMP_zend_optimizer_MAMP
Add:
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
- Save the file and restart the server
- Go to http://localhost:8888/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.
Spread the love