Debugging in NetBeans

posted on Wed, 03/10/2010 - 18:49 by

A while back I figured out how to set up Drupal debugging using Netbeans and MAMP PRO on Mac OSX. Of course I remounted my computer since then and lost it. After some time I finally figured out how to set it back up.

Download and compile the source at http://www.xdebug.org.

Take the debug.so file and copy it to your MAMP folder /Applications/MAMP/Library/share/php. If the directory doesn't exist just create it.

Once the file is in the correct place open MAMP PRO and Choose Edit Template >> PHP5 php.ini from the File menu.

The php.ini file will open in a text editor and allow you to make changes. Scroll all the way down to the bottom and look for the section [xdebug]. Remove any commented out lines underneath it and and add the following.

	zend_extension="/Applications/MAMP/Library/share/php/xdebug.so"
	xdebug.remote_enable=on
	xdebug.remote_handler=dbgp
	xdebug.remote_host=127.0.0.1
	xdebug.remote_port=9000

Now complete the process by saving the php.ini and restarting MAMP. Debugging should now be available in NetBeans through xdebug.