Avagy egy drupal programozó hétköznapjai

Using Xdebug With MAMP and Acquia Drupal Stack

2009-11-20 17:21

Recently I have switched from Linux to OS X.
In order to continue my job effectively I had to set up a proper development environment.
For programming tasks I prefer the NetBeans IDE, which is available for OS X.
I have not yet decided about the server side, so currently I’m testing two alternatives. Those are MAMP and the Acquia Drupal Stack which is a great help for Drupal development.
I picked Acquia Drupal Stack because most of my tasks are Drupal related and this tool can save me a lot of time.
You can watch Gabor Hojtsy’s presentation on Acquia Drupal Stack at DrupalCamp Hungary: here.

Enabling Xdebug in MAMP

Fortunately MAMP contains a pre-compiled xdebug.so file, so you only need to enable it in php.ini. At the same time make sure that Zend optimizer is disabled because it does not work together with Xdebug.
Edit php.ini using your favorite text editor:

Restart MAMP and check phpinfo()’s output. If you see the following lines then you’ve successfully enabled Xdebug.

Enabling Xdebug in Acquia Drupal Stack

Acquia Drupal Stack doesn’t contain a pre-compiled xdebug.so file, so you have two choices. Either you compile it from source or use MAMP’s pre-compiled xdebug.so file. I chose the latter one. (Note: MAMP ships with php 5.2.11, whilst Acquia Drupal Stack uses version 5.2.9.)

In this example Xdebug is using port 9080, which is needed to make sure that MAMP and Acquia Drupal Stack don’t use the same port.
If you are not going to use them simultaneously then port 9000 is also fine here.