This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Symfony2 Webserver Configuration

Discuss installing Symfony 2 here

Symfony2 Webserver Configuration

by aarmenaa » Mon Nov 05, 2012 2:44 pm

I'm having a horrible time figuring out an optimal webserver configuration for Symfony2. While I can easily set it up for development, getting it to run well is a another matter. It seems that no matter how I configure my webserver, either static resources are broken, or routing is seeing the name of the subdirectory and throwing an exception, or there's no nicely formatted URLs. I've looked at several example configurations (there used to one in the documentation, but it didn't work correctly and seems to have since disappeared), and they all seem to assume that Symfony2 will be running on its own server or at least in its own virtual host. Neither are acceptable solutions.

I have tried to create configs for this in both Nginx and Cherokee, but I can't seem to figure it out. I don't feel like my requirements here are out of line - they are things I'd expect any PHP application to be able to handle. It seems like Symfony is looking at the request URI and making assumptions about its location. I was hoping someone would have a good example of what the web server config should look like, or what needs to be modified in Symfony.
Junior Member
Posts: 1
Joined: Sun Sep 16, 2012 3:24 am

Re: Symfony2 Webserver Configuration

by tiagojsag » Mon Nov 05, 2012 2:54 pm


I never had to implement such a setup in a production environment, but a quick check to my http://localhost (i use local vhosts for my sf2 projects, so localhost shows the actual file listing with a bunch of sf project folders) tells me it does work like that (only img routes from css appear broken, but that's an easy fix).
The only thing you should need anything special is with skiping web/app.php, which can be done with nginx config. Google it, there are plenty of examples out there.

Can you be more specific on the type of problems you are having?

Tiago Garcia

Core Web Developer @ Shopware
User avatar
Faithful Member
Posts: 885
Joined: Wed Aug 10, 2011 4:58 pm

Re: Symfony2 Webserver Configuration

by lucian303 » Fri Jun 14, 2013 1:56 am

No, this does not work in apache either. I don't believe it's possible with sy 2.3, despite the documentation claims. Certainly, it's not possible in any way that was documented.
Junior Member
Posts: 2
Joined: Fri Jun 14, 2013 1:50 am