缺少fastcgi_params

时间:2017-09-26 11:59:25

标签: php nginx flarum

我使用来自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

1 个答案:

答案 0 :(得分:1)

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

所以改为

include fastcgi_params; 

include fcgi.conf;