The simpler alternative to running MAMP or XAMPP on Os X is using the built-in PHP, APache and getting a binary of Mysql. Although MAMP and XAMPP are simple ways also.
When I first installed mysql for my mac running Leopard just after it came out (end 2007), it was a bit flakey and casued a lot of people problems. So here is a mini tutorial for putting MySQL on Leopard now, since it is easy now, and more timely given cake php RC4 just got released
I can recommend these 2 guides as well as my notes here.
1) http://www.keithmedlin.com/2008/01/installing-cakephp-on-os-x-leopard-1051/
2) http://www.givegoodweb.com/post/53/cakephp-leopard-virtual-hosts
This pic is what we are aiming at with this install!
Right,let’s go! I am just installing Cake on a Mac mini running 10.5.2 and I noticed that finally Mysql seem to have provided a binary .dmg mac package on their website.(I think this came out in November as far as I can tell).
So go get the package from mysql:
http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg
make sure and pick the right processor type for your machine!
while waiting for that to download, I recommend also checking out the guides I linked above and set up your shell / profile and Apache for PHP with virtual hosts. This will allow easy development set-up where you can change from one app to another.
Now you should have your mysql .dmg ready by now, and you can just run that. So iside the .dmg you shd have a .pkg for mysql itself. install that first. Then run the start-up item and then finally the preference pane. ( this had problems before with Leopard, I think it is fixed now though!) When it asks I would install for all users, rather than current user only.
try a logout and back in and mysql should start automatically.
that’s pretty much it - check out the 2 linked tutorials to get any more info you need on PHP and so on!
The final gotcha is a weird one. I odn’t know why but if you put localhost as the @host@ in your cake database.php config…you’ll get a socket error in your PHP, when you load up a cakephp app (once you have followed the instructions for virtual hosts and so on).
So, despite having a working mysql and mysql-connectability via something like CocoaMysql, or the terminal, it does not conenct via PHP.
Then I googled a bit and found arecent blogpost with a simple fix! Just put 127.0.0.1 instead. Or indeed read the rest of the blogpost and get a fuller answer/solution.
luv boobyWomack xxx and a Merry Chrimbo to all cakettes everywhere ![]()