OS X: How to Install Symfony into MAMP
Posted by David Kirk in Apple Mac
Installing the open source php framework Symfony into an OS X box can be a challenge. By using MAMP and these directions, you will be up and running in no time.
MightyQ is becoming a jedi Symfony master. Just as I was getting skilled in plain ole php, he is now dragging me (correctly) into the world of Symfony. Here are the steps I used to get Symfony up and running in MAMP.
Now, I already had MAMP installed from my previous project of installing wp using MAMP in OS X.
If you do not have it, go ahead and download MAMP. Mount the MAMP dmg and drag the folder directly into your applications directory. Do not use a subdirectory.
Open the php.ini text file in a text editor. It should live here:
/Applications/MAMP/conf/php5/php.ini
Change the memory limit to 32M by editing the memory_limit part of the file to the following:
memory_limit = 32M ;
Save the file and close your text editor. Now fire up your terminal…
Now we are going to move leopard’s php to a safe place…
sudo mv /usr/bin/php /usr/bin/php-old
Link the MAMP php into where leopard’s php used to be…
sudo ln -s /Applications/MAMP/bin/php5/bin/php /usr/bin/php
If you have PEAR already installed, we are going to move it as well. If you don’t have PEAR, this will obviously error out which you can ignore.
sudo mv /usr/bin/pear /usr/bin/pear-old
Link MAMP’s PEAR into bin…
sudo ln -s /Applications/MAMP/bin/php5/bin/pear /usr/bin/pear
The following two commands will use PEAR to download and install symfony.
pear channel-discover pear.symfony-project.com
pear install symfony/symfony
Now place link symfony into bin…
sudo ln -s /Applications/MAMP/bin/php5/bin/symfony /usr/bin/symfony
If everything has worked correctly, you should now be able to fire up symfony from the command line.
Now that you have it installed, try working on the first symfony tutorial.
I originally got the majority of these directions from the following thread.
About David Kirk
View more articles by David Kirk
The Conversation
Follow the reactions below and share your own thoughts.
October 05, 2008 at 4:03 pm, Cindy said:
AWESOME!!! Thanks for the info! Saved me hours!
October 05, 2008 at 5:27 pm, davak said:
No problem! Welcome to the world of symfony! It’s an amazing framework!
October 17, 2008 at 1:42 am, Felix said:
Somehow it doesnt work, even though i followed everything and did not get any errors it always gives me “command not found” when i try to use any symfony commands like
symfony propel-build-all-load
December 13, 2008 at 5:20 pm, dave said:
symfony propel-build-all
December 13, 2008 at 5:21 pm, dave said:
or
symfony propel-build-model
symfony propel-build-sql
symfony propel-insert-sql
December 01, 2008 at 10:59 pm, Antonio said:
nice one! Thanks
December 13, 2008 at 5:19 pm, dave said:
Thanks a lot …. works great for me
May 08, 2009 at 11:45 pm, Keith Loy said:
Something you may want to add is a link to mysqladmin so that you can quickly setup databases from the command line as well.
sudo ln -s /Applications/MAMP/library/bin/mysqladmin /usr/bin/mysqladmin
is the line you’d do to do it.
Thanks for the help by the way, I was having issues getting symfony installed through pear.
January 13, 2010 at 7:51 pm, pieter said:
hi there
very good tutorial! thanks a lot, saved me couple of hours/days
I was wondering what these command lines do:
sudo ln -s /Applications/MAMP/library/bin/mysqladmin /usr/bin/mysqladmin
thanks!
Pieter
May 21, 2009 at 3:22 pm, Raúl said:
better with “sudo …”
June 13, 2009 at 6:21 pm, Chuck said:
Thanks. That was very very helpful
July 21, 2009 at 4:14 pm, Anonymous said:
I get a command not found on any symfony command I try. Any ideas?
July 06, 2010 at 7:04 pm, Flurdulis said:
I am getting permission denied when I try to run PEAR that is a symbolic link to a MAMP php5.3/bin/pear. Any solutions?
July 16, 2010 at 11:43 pm, LeadingLight said:
The executable bit is probably not set on the php and pear binary. Use these comands
cd /Applications/MAMP/bin/php5.3/bin and use
chmod +x php
chmod +x pear
December 26, 2010 at 12:16 am, wrightgd said:
I got everything installed correctly, but now I’m having a problem generating apps. I can’t help but thinking this might be somehow related to how the install locations/etc are different since I’m on a mac. Basically, when I run php symfony generate:app frontend in terminal, I receive no errors, but the directory structure the getting started tutorial describes is not created in the apps folder as it should be. Any ideas as to what might be causing this?