Saturday, March 5, 2011

CakePHP on Mac OSX

Ok, so some of you geeks out there may already know this, but I didn't so I will share it with you.

The newer version of Mac OSX has apache built into it. On OSX, Apache is called Web Sharing and the Web Server itself can be turned on in the System Preferences.

Also, PHP comes installed and ready to use via the command line.

If you want an actual Web Server stack there are a couple things you need to change to make it all work.
Htaccess – By default Mac disables the htaccess rewrites and stuff. So edit
the /etc/apache2/httpd.conf to AllowOverride in the Directory Directive.
PHP – By default Mac disables the PHP module. So edit the
/etc/apache2/httpd.conf and uncomment the PHP module.

And for those of us that wear the I heart CakePHP t-shirts...

To use the Cake Console directly from the command line – Add cake to the ENV path, by adding a simple file to the
/etc/paths.d directory that contains one line of the path to the cake console file.

And there you have it, a full blown Production Environment Grade Web Server right there in every Mac.

We use a Mac at work for preparing and uploading images to our web properties... I needed to tap a couple Soap APIs from the Mac and was getting ready to install the dreaded, bulky, MAMP. I was relieved when I found this fully functional web server built in, very cool.

No comments: