Installing Symfony in Mac with MAMP
I installed XAMPP for Mac OS X and installed symfony, and tried to run my project. Then I found XAMPP does not have PDO_MYSQL support. So I tried to install it by pecl install pdo_mysql, however, I was ended up in some problem that I couldn’t fix easily. The first impression was that the path for the php header file was not correct. After a struggle to make it correct, I switched to MAMP (http://www.mamp.info/) and find the peace of mind.
Install MAMP
- Put these directories in you path
- /Applications/MAMP/bin/php5/bin
- Most files that will be frequently used is in /Applications/MAMP/bin/
Install Symfony using peardev (to bypass the memory limit exceeding problem)
- sudo /Applications/MAMP/bin/php5/bin/peardev channel-discover pear.sy mfony-project.com
- sudo /Applications/MAMP/bin/php5/bin/peardev install symfony/symfony
Setting up Symfony
- Edit apache configuration file at /Applications/MAMP/conf/apache/httpd.conf
- Refer Symfony Documentation Chapter 3
An example virtual host configuration
<VirtualHost *:80> ServerName myapp.example.com DocumentRoot "/home/steve/myproject/web" DirectoryIndex index.php Alias /sf /Applications/MAMP/bin/php5/lib/php/data/symfony/web/sf <Directory "/Applications/MAMP/bin/php5/lib/php/data/symfony/web/sf"> AllowOverride All Allow from All </Directory> <Directory "/home/steve/myproject/web"> AllowOverride All Allow from All </Directory> </VirtualHost>- set
$sf_symfony_lib_diras/Applications/MAMP/bin/php5/lib/php/symfony - set
$sf_symfony_data_diras/Applications/MAMP/bin/php5/lib/php/data/symfony - Checkout Symfony project
- Let svn to ignore
cacheandlogdirectory
chmod 777 cache log
svn propedit svn:ignore cache
svn propedit svn:ignore log
- I’m using Doctrine as my ORM layer, and PHP CLI seems not working correctly, yet the web was okay.
symfony doctrine-insert-sqlcomplained that “doctrine couldn’t locate mysql driver.” It turned out, Mac OS X has php binary in the/usr/bin/directory. So I put the MAMP bin directory in the path prior to existed path variable.
July 16th, 2007 at 8:36 pm
[…] Installing Symfony in Mac with MAMP […]
August 27th, 2007 at 4:32 pm
“Edit apache configuration file at /Applications/MAMP/conf/httpd.conf”
For me I had to use /Applications/MAMP/conf/apache/httpd.conf
Not sure if anybody else has that change as well.
August 29th, 2007 at 12:41 am
Thanks, Andy. You are right. I’ve changed the typo. Thanks again.
September 25th, 2007 at 4:12 am
[…] problema viene con Symfony. IntentĂ© instalarlo tal como lo describen en esta web, pero, primero por mi inexperiencia con Mac, y despuĂ©s por diferentes errores enlazando […]
October 7th, 2007 at 12:28 am
Thank you for sharing!
October 20th, 2007 at 7:25 pm
Thanks for that, helped me get things sorted with Symfony CLI