Using the terminal with MAMP on OS X

Wednesday, November 8, 2006

Recently I was going to take the promising Symfony PHP framework out for a quick test drive, but ran into trouble in the very beginning of the tutorial. I’m running MAMP for local PHP development, but the terminal is using the built-in PHP version for its command line scripting. And Symfony is all about generating models and scaffolds through the command-line in a railsy sort of way… bummer.

A quick search for led me to a discussion thread in the MAMP forum, outlining the following solution. I’ve modified it a bit, using move instead of copy, and adding some necessary SUDO instructions:

  1. Backup current php version by renaming it (optional)
    $ sudo mv /usr/bin/php /usr/bin/php4
  2. Create a symbolic link pointing to the PHP version supplied by MAMP
    $ sudo ln -s /Applications/MAMP/bin/php5/bin/php /usr/bin/php
  3. Done!

Now, onwards with the tutorial

4 comments so far. Go ahead, write something

You can follow any responses to this entry through the RSS feed

thanks a lot :)

#1 balsagoth 28 Nov 06

Been stuck on this for a couple of hours but it works fine now. Thank you very much.

#2 BenvdS 28 Dec 06

Just thought you saved me on this one but installing via Pear still left me without a symfony.sh to be found anywhere on my system :-( Have you had any success or are you just using the sandbox example?

#3 Carsten Rose Lundberg 31 Dec 06

Thanks! This worked great. *NOTE: I’m only using the Sandbox right now.

#4 Jeff B. 25 Mar 07

Type here: