php.net |  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 - 35 = ?
Subscribe to this entry?

 
 [2018-08-03 16:09 UTC] qtogf8 at sambull dot org
Description:
------------
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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-03 21:12 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2018-08-03 21:12 UTC] requinix@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 12 22:01:28 2024 UTC