Nginx: nginx: [emerg] open() "/etc/nginx/snippets/fastcgi-php.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/app:20
The config includes a file (snippet, certificate, ssl option file) that doesn't exist.
nginx: [emerg] open() "/etc/nginx/snippets/fastcgi-php.conf" failed (2: No such file or directory)[emerg] open() failed (2: No such file or directory) in /etc/nginxnginx: [emerg] BIO_new_file("/etc/letsencrypt/live/x/fullchain.pem") failed[emerg] cannot load certificate ... BIO_new_file() failed no such fileopen() "/etc/nginx/mime.types" failed (2: No such file or directory) Meaning
Fix the path, create the file, or install the package providing it (snippets/fastcgi-php.conf from Debian/Ubuntu's nginx packages; options-ssl-nginx.conf from certbot). With include /path/*.conf; globs a missing directory is ignored, but a direct include fails.
Common causes
- Snippet/include file missing
- Certificate or key path wrong
- Package not installed (certbot nginx files)
- Relative include resolved from the wrong dir
- File renamed
⚡ Quick fix
ls -lthe path in the message- Reinstall the package or create the file
- Correct the
include/ssl_certificatepath
Detailed fix by platform
Linux
sudo nginx -tthenls -l /etc/nginx/snippets /etc/letsencrypt/live/DOMAIN
How to diagnose
- Path — Exists?
- Package — Provides it?
- Include — Relative base?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Cannot redeclare Fatal error: Cannot redeclare function foo() (previously declared in …)
- Could not automatically find a matching server block Certbot: Could not automatically find a matching server block for example.com. Set the `server_name` directive to use the Nginx installer
- could not build the server_names_hash, you should increase server_names_hash_bucket_size Nginx: nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 64
Most viewed in Nginx / Apache
- nginx: [emerg] unknown directive Nginx: nginx: [emerg] unknown directive "x" in /etc/nginx/sites-enabled/x:12 — configuration file test failed
- upstream timed out Nginx: upstream timed out (110: Connection timed out) while reading response header from upstream
- AH00558 Apache: AH00558: apache2: Could not reliably determine the server's fully qualified domain name
Other ways to find it
Where this error sits
Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026