phpnginxflarum

Missing fastcgi_params


I'm using NGINX from nginx-extras and Ajenti V with ajenti-v-nginx and ajenti-v. I have PHP 5.6 installed. However when I execute this code from Flarum Installation:

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;
}

And do a NGINX config check: sudo nginx -c /etc/nginx/nginx.conf -t I get

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

Output of ls /etc/nginx/

conf.d  fcgi.conf  mime.conf  nginx.conf  proxy.conf

Edit1: Seems like it's AjentiV, I reinstalled NGINX and somehow the configs deleted itself

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

==== Clicks the Restart Website button on Ajenti V ====

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

Solution

  • Every nginx setup is different. In your case there is no fastcgi_params files, instead there is fcgi.conf

    So change below

    include fastcgi_params; 
    

    to

    include fcgi.conf;