PermissionDenied: The process does not have the system-level permission to access a file, directory, or resource. A permission denied error means the operating system refused access to a file, folder, port or resource, because the user running the process lacks the right. In PHP it often appears as "failed to open stream: Permission denied".
Typical causes are folders that the web server user cannot write to, such as cache, logs or uploads, files created by root during a deploy, or a process trying to listen on a port below 1024 without privileges.
What should you keep in mind with PermissionDenied?
Find out which user the process runs as, such as www-data, and check ownership and permissions with ls -l. Fix the specific folder with chown or chmod instead of opening everything up with chmod 777. In Docker, mismatched user IDs between your machine and the container are a frequent cause, solved by running the container with the right user.
Use this skill when creating, modifying, or debugging Docker Compose configurations, even if the user just says they need to wire services together, add a database to their stack, or set up a local development environment with multiple containers. Covers service definitions, health checks, dependency ordering, volumes, networks, environment variables, and development overrides.