Yesterday I wanted to give myself a little update what’s going on in the PHP world as I was deeply involved in Java/J2EE in the last 4 years and haven’t done any PHP work besides maintaining some of my websites.
So I decided to give the Zend Framework a try and started going through the Quickstart guide.
Something what always enjoyed in the Java world was the availability of easy debugging. In PHP in the past I have used ugly „echo …“ debugging statements and never really digged any deeper. Now the time has come and I read that it is possible too but maybe with some more setup efforts.
- Mac OSX 10.6.1 (Snow Leopard)
- XAMMP for Mac OS
- Latest Eclipse PDT Full – I downloaded the 32bit Cocoa
The following articles helped me to get setup:
- Setting up Xdebug on Mac OS X (or Win32 / Linux)
Even though the articles are pretty good I had some minor problems, especially figuring out what exactly I have to add to my php.ini.
That’s why I give you what I have added to the very bottom of my php.ini which lives in the following path: /Applications/xampp/etc/php.ini
The xdebug.so was mentioned in first tutorial above and I got it from here (Komodo IDE: http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging)
Here are some important infos and screenshots which might be helpful in understanding my setup:
- php executable: /usr/bin/php
- php.ini: /Applications/xampp/etc/php.ini
One of the most important things was the Path-Mapping, which maps your Eclipse Project structure to the URLs of your web-application.
URL of my app in the browser: http://localhost/zendtest/ZendFramework-1.9.3PL1-minimal/quickstart
This mechanism is important, because it tells the debugger when to stop. If those settings are not correct (and they weren’t correct in my case) then the debugger will not recognize to which file the current URL in the browser belongs to and basically will not stop or will not stop at where you have placed your breakpoint.
Last but not least some screenshots which show the my setup and configuration: