One of the easiest (ie: fastest) way to have a fully working LAMP development environment on OS X is to install Zend Server, which is a package containing apache/php/mysql/zend framework and some other goodies
There is a free version available on the Zend Server Community Edition web page
One thing you might want to do after the installation is to add the Zend binaries in your path before the OS X bundled php/apache binaries.
Add this line to ~/.bash_profile OR ~/.profile
# Zend Server Community Edition export PATH="/usr/local/zend/bin:$PATH"
Your webserver should now be available on port 10088 and the Zend admin interface on port 10081
Xdebug
Zend Server CE comes bundled with the Zend Debugger, which is nice when your boss gaves you a Zend Studio licence to use the great profiler. But for me, at home, I use some other editor/IDE (Eclipse PDT, Komodo, TextMate, Netbeans…). So, when I want to profile a script/application, I use Xdebug, which can be used with webgrind or KCachegrind to profile your web application. Oh, and XDebug provides this nice formating for var_dump()… how could I resist.
Installing Xdebug on Zend Server CE on OS X
Adapted from the Windows instructions at http://forums.zend.com/viewtopic.php?f=8&t=553
Save yourself some time and get the pre-compiled Xdebug binaries for OS X from Activestate. And while you’re there, you should download and try Komodo IDE/Edit if you have never done so.
From the archive, copy the file
5.2/xdebug.so
to
/usr/local/zend/lib/php_extensions/
Before using Xdebug though, you have to disable the Zend Debugger. Open the file
/usr/local/zend/etc/conf.d/debugger.ini
and comment the line starting with
zend_extension_manager.dir.debugger
by adding a semicolon at the start of the line
Now, to tell PHP that we’re using Xdebug, add these lines in /usr/local/zend/etc/php.ini just before the [zend] section
[xdebug]
zend_extension="/usr/local/zend/lib/php_extensions/xdebug.so"
Now if you restart your web server, you should see Xdebug in the View PHPinfo page link of the admin dashboard
sudo /usr/local/zend/bin/zendctl.sh restart-apache
