Nginx+;php fpm返回空白页或“返回”;未指定输入文件";
我在Debian稳定的系统上使用带有php5 fpm的nginx。以下是我的默认站点:Nginx+;php fpm返回空白页或“返回”;未指定输入文件";,php,nginx,Php,Nginx,我在Debian稳定的系统上使用带有php5 fpm的nginx。以下是我的默认站点: server { listen 443 default_server; server_name _; root /home/www/known; # Deny access to dot files and dirs location ~ /\. { access_log off; log_not_found off; deny all; } # Enable PHP for v
server {
listen 443 default_server;
server_name _;
root /home/www/known;
# Deny access to dot files and dirs
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
# Enable PHP for vhosts
index index.php index.html index.htm index.nginx-debian.html;
location ~ \.php$ {
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
ssl on;
ssl_certificate /etc/ssl/certs/phyks.me/root.crt;
ssl_certificate_key /etc/ssl/private/phyks.me/root.key;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
PHP部分取自Debian中与Nginx捆绑的PHP fastcgi片段。存在/home/www/known/index.php文件,并且可以被www数据读取(nginx和php-fpm都以这种方式运行),但是我得到了一个“未指定输入文件”,尽管nginx将文件路径正确地传递给php-fpm
我试图将php文件的位置块的内容替换为
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
在本例中,我有一个空白页面(状态为200),无法从php5 fpm或nginx获取任何详细的日志输出
我已经被这个问题困扰了好几个小时,尝试了不同的配置选项,但无法弄清楚到底发生了什么…你有什么想法吗?另外,类似的配置也适用于其他服务器
谢谢 请检查您的
/etc/nginx/fastcgi.conf
或/etc/nginx/fastcgi\u params
是否包含此参数脚本\u文件名$request\u文件名代码>或将其附加到文件。这并不能回答问题。若要评论或要求作者澄清,请在他们的帖子下方留下评论。@dhh:请再详细说明一下,因为对于可怜的nginx配置程序来说,例如“我是”这个答案似乎确实可行。在Ubuntu 16.04中,“fastcgi.conf”和“fastcgi_”参数“我们已经发货了。唯一的区别是fastcgi.conf包含SCRIPT_文件名设置。将include行切换到“include fastcgi.conf;”会拉入设置。非常烦人,因为PHP FPM即使在启用调试的情况下也不会记录错误。