缺少 fastcgi_params

Missing fastcgi_params

我使用 nginx-extras 的 NGINX 和 ajenti-v-nginxajenti-v 的 Ajenti V。我安装了 PHP 5.6。但是,当我从 Flarum 安装执行此代码时:

location ~* \.php$ {
    fastcgi_split_path_info ^(.+.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTP_PROXY ""; # Fix for https://httpoxy.org/ vulnerability
    fastcgi_index index.php;
}

并进行 NGINX 配置检查:sudo nginx -c /etc/nginx/nginx.conf -t 我得到

nginx: [emerg] open() "/etc/nginx/fastcgi_params" failed (2: No such file or directory) in /etc/nginx/conf.d/flarum.conf:39

ls /etc/nginx/

的输出
conf.d  fcgi.conf  mime.conf  nginx.conf  proxy.conf

Edit1:好像是 AjentiV,我重新安装了 NGINX,但不知何故配置自己删除了

root@notascam:/etc/nginx# ls
conf.d        fastcgi_params  koi-win     nginx.conf    scgi_params      
sites-enabled  uwsgi_params
fastcgi.conf  koi-utf         mime.types  proxy_params  sites-available  
snippets       win-utf
root@notascam:/etc/nginx# sudo service nginx start
root@notascam:/etc/nginx# ls
conf.d        fastcgi_params  koi-win     nginx.conf    scgi_params      
sites-enabled  uwsgi_params
fastcgi.conf  koi-utf         mime.types  proxy_params  sites-available  
snippets       win-utf

==== 点击 Ajenti V 上的重启网站按钮 ====

root@notascam:/etc# cd nginx
root@notascam:/etc/nginx# ls
conf.d  fcgi.conf  mime.conf  nginx.conf  proxy.conf

每个 nginx 设置都不同。在您的情况下,没有 fastcgi_params 文件,而是 fcgi.conf

下面改一下

include fastcgi_params; 

include fcgi.conf;