I recently had to get some CakePHP code running on my local OS X environment.
CakePHP requires
- an HTTP Server --Snow Leopard includes Apache that can use mod_rewrite
- PHP 4.3.2 or greater -- Snow Leopard includes PHP 5.3
- a database -- It's easy to install MySQL on OS X
Here's a great blog post to get all this setup:
Install Apache/PHP/MySQL on Snow Leopard
Next you just need to install CakePHP so it is visible in Apache's Document Root.
I created a new project folder on my hard drive's root, /cake_project and extracted the CakePHP 1.3 files downloaded from the website there.
Then updated the Apache httpd.conf file to setup the appropriate mod_rewrite and Document Root settings.
sudo vi /etc/apache2/httpd.conf
Editing:
DocumentRoot "/cake_project/app/webroot"
and
<Directory "/cake_project/app/webroot">
...
AllowOverride All
Now just restart apache:
sudo apachectl restart
Ensure that /cake_project and it's underlying files have the correct permissions set. (Remember that apache runs as the www user.)
And setup your cake config to point to your MySQL database. (You will have to create a new database and users.)
Also, not that CakePHP 1.3 requires you to modify your /app/config/core.php file since you are using PHP 5.3. Just uncomment this line:
/**
* If you are on PHP 5.3 uncomment this line and correct your server timezone
* to fix the date & time related errors.
*/
//date_default_timezone_set('UTC');
Let me know if it works!