Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46b7b42

Browse files
author
Dirk Pahl
committed
Add properly configured Symfony2 Standard Edition to the box
1 parent 25ef6dd commit 46b7b42

File tree

6 files changed

+573
-15
lines changed

6 files changed

+573
-15
lines changed

Readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Installation
99
* Clone this repository
1010
* Run ```vagrant init precise64``` for a single time (use choosen box name) inside the cloned repository
1111
* After running ```vagrant up``` the box is set up using Puppet
12-
* You should now have your working nginx pointing to the www directory as document root under http://localhost:9090/ (showing phpinfo() ouput actually)
12+
* You should now have your working Symfony2 Standard Edition under http://localhost:9090/app_dev.php
1313

1414
Installed components
1515
--------------------
@@ -20,6 +20,7 @@ Installed components
2020
* [pear](http://pear.php.net/)
2121
* [Node.js](http://nodejs.org/)
2222
* [npm](http://npmjs.org/)
23+
* [Symfony2 Standard Edition](https://github.com/symfony/symfony-standard)
2324

2425
TODO
2526
----

conf/nginx/default

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,34 @@ server {
44
access_log /var/log/nginx/localhost.access.log;
55
error_log /var/log/nginx/localhost.error.log error;
66

7+
# strip app.php/ prefix if it is present
8+
rewrite ^/app\.php/?(.*)$ /$1 permanent;
9+
710
## Default location
811
location / {
9-
root /vagrant/www;
10-
index index.php;
12+
root /vagrant/www/symfony/web;
13+
index app.php;
14+
try_files $uri @rewriteapp;
1115
}
1216

17+
location @rewriteapp {
18+
rewrite ^(.*)$ /app.php/$1 last;
19+
}
20+
1321
## Images and static content is treated different
1422
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
1523
access_log off;
1624
expires 30d;
17-
root /vagrant/www;
25+
root /vagrant/www/symfony/web;
1826
}
1927

20-
## Parse all .php file in the /vagrant/www directory
21-
location ~ .php$ {
22-
root /vagrant/www;
28+
## Parse all .php file in the /vagrant/www/symfony/web directory
29+
location ~ ^/(app|app_dev)\.php(/|$) {
30+
root /vagrant/www/symfony/web;
2331
fastcgi_split_path_info ^(.+\.php)(.*)$;
2432
fastcgi_pass backend;
2533
fastcgi_index index.php;
26-
fastcgi_param SCRIPT_FILENAME /vagrant/www$fastcgi_script_name;
34+
fastcgi_param SCRIPT_FILENAME /vagrant/www/symfony/web$fastcgi_script_name;
2735
include fastcgi_params;
2836
fastcgi_param QUERY_STRING $query_string;
2937
fastcgi_param REQUEST_METHOD $request_method;
@@ -48,5 +56,5 @@ server {
4856

4957
## php-fpm backend
5058
upstream backend {
51-
server 127.0.0.1:9000;
59+
server 127.0.0.1:9000;
5260
}

conf/php/custom.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
date.timezone = "Europe/Berlin"
2+
3+
short_open_tag = Off

0 commit comments

Comments
 (0)