A PHP error mentions a restricted file path (open_basedir)
What this common PHP error means and how to resolve it for a customer.
PHP applications on your server are restricted to reading and writing only within their own account's files. This is a deliberate protection: it stops one customer's website from being able to read another customer's files even if a bug or a vulnerability in the application would otherwise allow it. When an application tries to reach a file outside that boundary, PHP refuses and logs an error mentioning open_basedir restriction in effect.
What it usually means
Almost every case comes down to one of two things: the application is genuinely trying to read a file that doesn't belong to it, or a path in the application's own configuration points somewhere it shouldn't, most often because a setting was copied from a different server with a different folder layout.
Steps
- Read the exact path named in the error message. It tells you precisely what the application was trying to reach.
- If that path is outside the account's own home folder entirely, the application's configuration almost certainly needs correcting to point at a location inside the account.
- If the path is inside the account but the application still can't reach it, confirm the file actually exists there and check its permissions using the file permission article in this section.
- If a shared resource genuinely needs to be reached from more than one account's website, for example a file store shared between several customer sites, that needs to be set up deliberately with the account, not worked around by disabling the protection itself.