【发布时间】:2014-03-18 14:05:29
【问题描述】:
我用 php fpm 安装了 Nginx,并进行了配置,在我下载 Symfony2 之前,一切似乎都运行良好。当我尝试访问 app.php 时,我得到服务器返回了“404 Not Found”。错误,当我尝试访问 app_dev.php 时,我得到 RuntimeException: Unable to write in the logs 目录,因为我在http://symfony.com/doc/current/book/installation.html 教程中尝试的错误明确说明了权限问题,提供了 ACL 解决方案,但这没有帮助,事件在 app/console、web/app_dev.php、web/app.php 中尝试了“unmask(0000)”,也没有成功。 我的 nginx 设置:
upstream phpfcgi {
#server 127.0.0.1:9000;
server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}
server {
listen 80;
server_name localhost;
root /home/antanas/public_html/demo/web;
error_log /var/log/nginx/demo.error.log;
access_log /var/log/nginx/demo.access.log;
# strip app.php/ prefix if it is present
rewrite ^/app\.php/?(.*)$ /$1 permanent;
location / {
index app.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass phpfcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
这个问题的原因可能是什么?
【问题讨论】: