2013-09-29 201 views
0

我試圖在ubuntu上的php5-fpm + nginx服務器上安裝Symfony。nginx的服務器配置文件

當我進入到/web/app_dev.php它顯示一個錯誤:在加載網頁調試工具發生

錯誤(404:未 找到)。

你想打開分析器嗎?

當我進入到分析器(/web/app_dev.php/_profiler/0db7ac)它告訴:指定

沒有輸入文件。

我知道我的服務器配置文件存在問題。這裏是:

server { 

      listen 80; 

      # listen [::]:80 ipv6only=on; 

      root /home/marker/Projects/stereoshoots/www; 

      access_log /home/marker/Projects/stereoshoots/logs/access.log; 

      server_name stereoshoots.local; 

      index index.php index.html index.htm; 





      location/{ 

        autoindex on; 

    #    try_files $uri $uri/ @rewrite; 

        try_files $uri $uri/ /index.php; 

      } 

    #  location @rewrite { 

    #    rewrite ^/(.*)$ /index.php?q=$1; 

    #  } 

      location ~* \.(jpg|jpeg|gif|css|png|js|ico|xml|txt)$ { 

       access_log  off; 

       expires   30d; 

      } 

      location = /favicon.ico { 

        return 204; 

        access_log  off; 

        log_not_found off; 

      } 

      location ~ \.php$ { 

        fastcgi_pass unix:/var/run/php5-fpm.sock; 

        fastcgi_index index.php; 

        include fastcgi_params; 

      } 

      location ~ /\.ht { 

        deny all; 

      } 



    } 

我應該編輯什麼,以獲得symfony安裝權?

謝謝!

回答

0

我想留下的唯一的事情就是到URI傳遞給index.php

try_files $uri $uri/ /index.php$request_uri 
0

你真的有index.php文件?

試試這個:

index app_dev.php; 

try_files $uri $uri/ @rewrite; 

location @rewrite { 
    rewrite ^/(.*)$ /app_dev.php/$1; 
} 

location ~ \.php { 

    include fastcgi_params; 
    fastcgi_split_path_info ^(.+\.php)(/.+)$; 
    fastcgi_param PATH_INFO $fastcgi_path_info; 
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    fastcgi_param SERVER_PORT 80; 
    fastcgi_param SERVER_NAME stereoshoots.local; 

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    fastcgi_pass unix:/var/run/php5-fpm.sock; 
    fastcgi_index app_dev.php; 
} 

注意,我改變location ~ \.php$location ~ \.php