# Nginx: nginx: [emerg] open() "/etc/nginx/snippets/fastcgi-php.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/app:20

**Code:** `nginx: [emerg] open() failed (2: No such file or directory)` · **Category:** Nginx / Apache · **Seen on:** Nginx, Linux

The config includes a file (snippet, certificate, ssl option file) that doesn't exist.

## 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

1. `ls -l` the path in the message
2. Reinstall the package or create the file
3. Correct the `include`/`ssl_certificate` path

## Detailed fix by platform

### Linux

1. `sudo nginx -t` then `ls -l /etc/nginx/snippets /etc/letsencrypt/live/DOMAIN`

## How to diagnose

1. **Path** — Exists?
2. **Package** — Provides it?
3. **Include** — Relative base?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nginx-apache/nginx-emerg-open-failed-include-no-such-file)
