I decided to give the recent Symfony 1.1.0 RC1 a try on my macbook. Here are the steps I took to get it working.
NOTE: This tutorial was created on 5.16.2008 and may not be true with future release of OS X Leopard or with future Symfony 1.1 releases.
All text editing is done with Textmate, but you may choose to substitute anything you wish like vi or pico in the place of mate where you see it in these instructions.
1. Install via PEAR
pear channel-discover pear.symfony-project.com pear install symfony/symfony-1.1.0RC1
PEAR will now download and install Symfony.
2. Create a new Symfony project
cd ~/Sites mkdir sandbox cd sandbox symfony generate:project sandbox symfony generate:app frontend
Okay, so now you’ve tested that Symfony’s command line tools work, generated a new project and an application within that project.
3. Fire up apache (if you don’t have it started already)
sudo apachectl restart4. Load your new project at http://localhost/sandbox
You should see the Symfony splash page, sans graphics and style. It should just be some text on a white background. There are a few steps left to getting it up and running.
5. Modify your Apache’s virtual hosts file:
sudo mate /private/etc/apache2/extra/httpd-vhosts.conf
6. Now you need to add the VirtualHost directive for Symfony. Just add the following at the bottom of the file.
AllowOverride All Allow from All DocumentRoot "/Users/YOURUSERNAME/Sites/sandbox/web" ServerName www.sandbox.dev DirectoryIndex index.php Alias /sf /usr/share/pear/data/symfony/web/sf AllowOverride All Allow from All
Save this file and close it. We’re ready for the final step that is specific to OS X Leopard from what I can tell.
7. Open up your httpd.conf and make the following changes
sudo mate /etc/apache2/httpd.conf
Then find:
Options FollowSymLinks AllowOverride None Order deny,allow Deny from all
Change it to:
Options FollowSymLinks AllowOverride None #Order deny,allow #Deny from all
8. Set up your host name in the /etc/hosts file.
sudo mate /etc/hosts
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 127.0.0.1 www.sandbox.dev 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost
9. The final step is to restart apache to make the changes.
sudo apachectl restart10. Load up http://www.sandbox.dev/ and you should now see the styled brown welcome page for your Symfony 1.1 sandbox project!



Leave a Reply