open_basedir PHP Origin: Application & API OSI layer 7 · Application Last updated 13 Oct 2026

Warning: file_exists(): open_basedir restriction in effect. File(/x) is not within the allowed path(s)

PHP is configured to access only certain directories, and the script tried to touch a file outside them.

Exact message you may see open_basedir restriction in effectis not within the allowed path
Seen on: PHP

Meaning

Shared hosts set open_basedir to your account directory. Paths outside it — /tmp, another site’s folder, or absolute paths copied from a different server — are blocked.

Common causes

  • Absolute path from another server/environment
  • Temp/upload directory outside the allowed paths
  • Symlinks pointing outside the allowed tree

⚡ Quick fix

  1. Use paths inside your account (e.g. __DIR__-relative)
  2. Set upload_tmp_dir/sys_get_temp_dir() to a directory inside the allowed paths
  3. Ask the host or adjust open_basedir in the PHP selector

Detailed fix by platform

PHP

  1. Check the current value with ini_get('open_basedir')

How to diagnose

  1. Allowed — Which paths are allowed (in the message)?
  2. Requested — Which path did you use?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

1000 — Cloudflare Error 1000: DNS points to prohibited IP (Cloudflare)1000AADSTS90002 — AADSTS90002: Tenant 'x' not found (Azure)AADSTS90002Access to the path is denied — System.UnauthorizedAccessException: Access to the path 'x' is denied (.NET)Access to the path is…AH00558 — Apache: AH00558: apache2: Could not reliably determine the server's fully qualified domain name (Nginx / Apache)AH00558api_version_invalid — API Error: Invalid or unsupported API version (API)api_version_invalidAzureWebJobsStorage — Azure Functions: Value cannot be null. (Parameter 'connectionString') / Missing value for AzureWebJobsStorage (Azure)AzureWebJobsStorageConnectionString property has not been initialized — InvalidOperationException: The ConnectionString property has not been initialized (.NET)ConnectionString prop…divergent branches — hint: You have divergent branches and need to specify how to reconcile them. (Git)divergent branchesopen_base…

Explore the map of this error Full error map →

🧠 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.