gpt4 book ai didi

php - $document_root 上的 nginx 和尾部斜杠?

转载 作者:可可西里 更新时间:2023-10-31 22:50:17 24 4
gpt4 key购买 nike

我对 nginx 使用以下配置:http://gist.github.com/340956

但是,此配置会导致 PHP 出现 No input file specified 错误。我能够解决它的唯一方法是改变这一行:

fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;

注意 $document_root$fastcgi_script_name 之间的“/”。我被告知这是错误的配置,但没有人能够确切地告诉我为什么我的配置需要这个额外的斜线。

我怎样才能去掉那个多余的斜杠?

最佳答案

刚遇到同样的问题(在RHEL6服务器上重新安装nginx+php-fpm),在/etc/nginx/fastcgi_params中添加下面一行即可解决

fastcgi_param  SCRIPT_FILENAME    $request_filename;

我发现这一行在 RHEL 中缺失,而在完美运行的 Debian nginx 中存在。

关于php - $document_root 上的 nginx 和尾部斜杠?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2498661/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com