Getting this configured is simple enough, once you read 10,000 web pages. MAMP 2.0.5 ships with xdebug installed, but in my experience it does not work - at least, it does not work for me, on my 2.66 Ghz MacBook Pro 17”, running OS X 10.7.3. Internet research seems to indicate that this may be a 32bit vs 64bit problem.
So, here’s what I did to make it work:
First - Don’t use the MAMP built-in xdebug.so file. In your MAMP php.ini file there’s this line:
zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
Replace it with this line:
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
OS X ships with a working version of xdebug - that’s what we’re using here.
Second - don’t use Chrome. At least for me, Chrome (I’m using the beta channel, so that may be part of the issue), does not work with the PHPStorm debugger - breakpoints are never triggered. Firefox (beta as well) works fine.
With the above two constraints, you can then follow the PHPStorm documentation on creating a zero-configuration debugging environment (basically, create a “PHP Web Application” debugging configuration), and everything will work correctly. In my case, I’m calling PHP code via XHR from an ExtJS front-end - PHP breakpoints work perfectly, I can step through code, examine variables, etc etc.


Recent Comments