|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76701 open_basedir restriction when file doesn't exist
Submitted: 2018-08-03 16:09 UTC Modified: 2018-08-03 21:12 UTC
From: qtogf8 at sambull dot org Assigned:
Status: Duplicate Package: Safe Mode/open_basedir
PHP Version: 7.0.31 OS: Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: qtogf8 at sambull dot org
New email:
PHP Version: OS:


 [2018-08-03 16:09 UTC] qtogf8 at sambull dot org
This seems to be much the same issue as #41518. But, maybe it only occurs when exactly matching a file.

i.e. When using file_exists(), I get an error along the lines of:
PHP Warning:  file_exists(): open_basedir restriction in effect. File(/foo/somefile.php) is not within the allowed path(s): (/foo/somefile.php) in ...

Clearly, the error is wrong, when the allowed path is exactly the same as the file name. If I create the file, then the warning disappears, which proves that it is in the allowed path.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-03 21:12 UTC]
-Status: Open +Status: Duplicate
 [2018-08-03 21:12 UTC]
See bug #52065 and all the other "related to" bugs listed in its comments.

Short explanation: in some circumstances, when PHP searches for the file and can't find it, other code incorrectly assumes the failure is because of an open_basedir restriction. The easiest example of this is with the path foo/bar when foo is a file and not a directory.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon May 29 06:03:41 2023 UTC