PHP Dev environment on the MAC

Hi guys,

I’m not sure if I’m in the right forum for this, but would someone be able to give me some pointers on how they have their PHP dev environment set up on the MAC (I’m on 10.5.8)

Is it common to have all your source files in e.g. ‘usr/local/git’ and then your staging in the ‘Sites’ folder or ‘usr/local/www’ or ‘var/www’

I just don’t know what’s best, I really want to get a nice structure in place, it’s a bit of mish mash at the mo, it took me long enough to work out how php is distributed?

Any help would be much appreciated

Crabby80

I used to use the versions of Apache, PHP and mySQL that came with OS X, however every time I needed to reformat my drive it became a pain in the butt, so I purchased Mamp Pro and it has made my life much easier.

I store all of my sites in the Users/username/Sites folder, i.e., ?Users/tim/Sites/mysite/ and use virtual hosts, such as http://mysite.loc for testing. This makes it easy in my config file because I only need to change my ‘site.loc’ to my ‘mysite.com’ and I’m good to go.

You can basically store each site where you feel comfortable, such as in the Documents folder, or a Clients folder, or in the Mamp htdocs folder.

Or MAMP for free… MAMP: Mac, Apache, MySQL, PHP

I used Mamp free but upgraded to pro because with the free version I still had to monkey around with virtual hosts. Mamp Pro has virtual host support built in so it’s much easier. That justified the $60 price tag to me. :slight_smile:

Zend Server (http://www.zend.com/en/products/server-ce/downloads)
Gasmask (http://www.clockwise.ee/gasmask/ - hosts file manager)

/Users/Shared/Projects/site1/
/Users/Shared/Projects/site2/
/Users/Shared/Projects/site3/
/Users/Shared/Projects/dev_vhosts.conf (linked to from main httpd.conf)

I keep all sites in ~/Sites, naturally.

I use macports to manage PHP 5.3 and its extensions.

I run the pre-installed Apache.

I install MySQL from the official DMG packages.

I use VirtualHostX to manage the Apache config when I’m feeling lazy.

Thanks for your replies guys