Archive

Archive for April, 2009

Installing CakePHP with MAMP

April 29th, 2009 Krow 3 comments

At work we have a few developers that use Mac’s. I have come to like them much more then I used to. So much I bought one for my wife. Still not for me cause I can buy a PC for much cheaper and have grown very happy with Ubuntu.

Any way to the topic at hand I found that helping set up CakePHP on a Mac with MAMP was a bit different and thought I would post here for others to use and for myself to reference if I need to do it again.

These steps are based on the environment we work on and are in some cases preferences too. You can choose to do the steps differently to your setup but for my purposes this has worked great.

  1. Download the latest version of CakePHP (http://www.cakephp.org)
    At the time of this writing the current version of CakePHP is 1.2.2.8120
  2. Unzip and rename the folder to cake
  3. Go to the “Sites” directory and drop the new cake directory there
  4. Find the path for the CakePHP console (i.e. /Users/username/Sites/cake/cake/console )
  5. Find the path for the php directory (i.e. /Applications/MAMP/bin/php5/bin )
  6. Launch a terminal window
    • Type nano .profile
      • Some alias I prefer to have:
        • alias www=”cd /Users/username/Sites/public_html”
        • alias mysql=”cd /Applications/MAMP/Library/bin/mysql -uroot -p”
      • Enter the following:
        • export PATH=”/Applications/MAMP/bin/php5/bin:/Users/username/Sites/cake/cake/console:$PATH”
        • CTRL X
        • Save
    • Restart your profile
      • . .profile
  7. In your terminal you can now bake
    • Type www
    • This will take you to your web directory
    • Type cake bake project name…

That is it. As I mentioned this post is mostly for a refrence for myself but I hope that it can be a help to others as well. But I would be interested to hear what others have to say and prefer.

Categories: Tips & Tricks Tags: , ,