Missing fastcgi_params when when using PHP-FPM with Nginx server setup from H5BP


I recently switched to using the Nginx server boilerplate configs from H5BP. When I try to test my configuration, I get an error saying fastcgi_params is missing. I confirmed it’s not there or anywhere else in their current boilerplate configs.

sudo nginx -t
nginx: [emerg] open() "/etc/nginx/fastcgi_params" failed (2: No such file or directory) in /etc/nginx/sites-enabled/mydomain.tld:62
nginx: configuration file /etc/nginx/nginx.conf test failed

This wasn’t a problem before I switched. What am I missing?


Current versions of Nginx come with the fastcgi configuration in /etc/nginx. If you follow the example from the boilerplate configs, your configuration directory won’t have any of the configuration files for fastcgi, scgi, or uwsgi that you would normally have.

An author of the config boilerplate recently commented that the repo was intended to be scripting-language agnostic:

It’s not the intention of this repo to replace official resources. On a low level, nginx’s documentation covers what’s possible, on a higher level (though possibly of dubious quality) the wiki has a large number of examples. Also, ordinarily when installing a package such as php-fpm – it’ll create default fast cgi config files for you. Is there a need to provide more than a user could/should already have?

If you followed the h5bp/server-configs-nginx example, you can just copy those files over.

cd /etc/nginx-previous/
sudo cp uwsgi_params scgi_params fastcgi.conf fastcgi_params /etc/nginx/

If you don’t have the previous configuration directory, you can also just grab new copies from Nginx on GItHub.

You are viewing 1 out of 3 answers, click here to view all answers.