This post is about setting up XMAPP on a mac with xdebug.
The first thing we are going to do is to change the document root inside xampp to the ‘Sites’ folder. Changing the DocumentRoot has a few benefits – one being that its far easier to get to in the finder and your editor!
Changing the DocumentRoot in XAMPP
- Install xampp from apachefriends.org
- open /Applications/XAMPP/xampfiles/etc/ in finder; right click > get info
make sure its read / write by everyone
- open /Applications/XAMPP/xampfiles/etc/httpd.conf
- scroll down to ‘DocumentRoot’
- type in the location of your ‘sites’ folder [ /Users/username/Sites ]
- scroll down to the <Directory> config
- replace /Applications/XAMPP/xamppfiles/htdocs with /Users/username/Sites
- restart apache
- goto http://localhost to see what you have =)
setting up xDebug
This will allow you to have proper debugging for your php apps. In the long run this will save you hours of time.