Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to run symfony on my apache installation (I'm using xampp for the whole package) and it keeps giving me a 403 error every time I try to access my website.

I've got vhosts set up with the following:

<VirtualHost *:80>
  ServerName localhost
  DocumentRoot "/opt/lampp/htdocs"
  DirectoryIndex index.php
  <Directory "/opt/lampp/htdocs">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName servername.localhost
    DocumentRoot /home/me/web/server/web
    DirectoryIndex index.php
    Alias /sf "/lib/vendor/symfony/data/bin/web/sf"

    <Directory "/home/me/web/server/web">
      AllowOverride All
      Allow from All
    </Directory>
</VirtualHost>

<Directory "/lib/vendor/symfony/data/bin/web/sf">
    Allow from All
</Directory>

I've also added "127.0.0.1 servername.localhost" in my hosts file.

When I try to access "servername.localhost" it just gives me a 403 error. I've chmod'd 777 the symfony directory and my website directory in my home directory and used './symfony project:permissions' to let symfony check that permissions are set up correctly but still not result.

If I move my website directory into "/opt/lampp/htdocs" then it will serve it from there but still has problems access the symfony stuff such as the debug toolbar.

Any help would be appreciated.

share|improve this question
    
Can you verify that NameVirtualHost has been set? –  Rob Olmos Sep 4 '10 at 9:22
    
Yes, just above the information from the vhosts there, I have ' NameVirtualHost *:80'. –  Dominic Santos Sep 4 '10 at 10:37
    
I have double checked the permissions of everything leading to my website's directory and some of them were not set to +x, so I've done that but am now presented with a blank page when I go to 'servername.localhost'. I have checked the access logs for the server and I am presented with '127.0.0.1 - - [06/Sep/2010:11:01:33 +0100] "GET / HTTP/1.1" 500 -'. –  Dominic Santos Sep 6 '10 at 10:05
1  
Try servername.localhost/frontend_dev.php. –  Steve Oct 2 '10 at 12:35

2 Answers 2

Symfony requires some rewrite rules, I don't see why the .htaccess wouldn't be present unless you've removed it- is mod_rewrite enabled?

share|improve this answer

403 is usually Directory Browsing Forbidden (checking Apache's error log should confirm this).

Is there a default document (index.php) in your /home/me/web/server/web directory?

You've aliased Symfony into /sf, so you'd have to hit http://servername.localhost/sf to access it, not the top level http://servername.localhost/.

share|improve this answer
    
I have got an 'index.php' file in the '/home/me/web/server/web' folder; I also tried accessing 'servername.localhost/sf' but it gave me 404 error. –  Dominic Santos Sep 6 '10 at 8:39
    
The alias is just to symfony's web folder, it just contains some images and css for the symfony branded error pages- nothing integral; it's usually removed from everything bar development environments. –  Steve Oct 2 '10 at 12:06
    
Symfony has frontend web controllers, all urls should go through it (usually index.php) for dev there's also frontend_dev.php which provides more detailed errors. –  Steve Oct 2 '10 at 12:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.