4

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.

4
  • Can you verify that NameVirtualHost has been set?
    – Rob Olmos
    Commented Sep 4, 2010 at 9:22
  • Yes, just above the information from the vhosts there, I have ' NameVirtualHost *:80'. Commented Sep 4, 2010 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 -'. Commented Sep 6, 2010 at 10:05
  • 1
    Try servername.localhost/frontend_dev.php.
    – Steve
    Commented Oct 2, 2010 at 12:35

2 Answers 2

0

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?

0

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/.

3
  • 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. Commented Sep 6, 2010 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
    Commented Oct 2, 2010 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
    Commented Oct 2, 2010 at 12:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .