|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60636 Dots in folders results in a open_basedir restriction warning
Submitted: 2012-01-02 13:56 UTC Modified: 2012-01-04 04:34 UTC
Avg. Score:4.0 ± 1.3
Reproduced:7 of 8 (87.5%)
Same Version:2 (28.6%)
Same OS:3 (42.9%)
From: fernando at consultorpc dot com Assigned:
Status: Open Package: Safe Mode/open_basedir
PHP Version: 5.3.8 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-01-02 13:56 UTC] fernando at consultorpc dot com
If you try to access a file within a folder that has a dot, an open_basedir 
restriction warning will show up even if the folder is in the allowed paths list.

Test script:
// Set open_basedir allowed paths to /home/example:/usr/lib/php:/tmp

file_exists('/home/example/public_html/myfolder.example/file.php'); // This results in a open_basedir restriction warning

Expected result:
No warning should show up and i should be able to access the file normally.

Actual result:
The test script results in:

PHP Warning:  file_exists() [<a href='function.file-exists'>function.file-
exists</a>]: open_basedir restriction in effect. 
File(/home/example/public_html/myfolder.example/file.php) is not within the 
allowed path(s): (/home/example:/usr/lib/php:/tmp) in 
/home/example/public_html/test.php on line 3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-03 17:06 UTC]
does that /home/example exists? I think this might has nothing to do with the 
*dot*, but a mis-understand warning.
 [2012-01-03 17:06 UTC]
-Status: Open +Status: Feedback
 [2012-01-03 17:13 UTC] fernando at consultorpc dot com
-Status: Feedback +Status: Open
 [2012-01-03 17:13 UTC] fernando at consultorpc dot com
Yes, /home/example exists. If i rename myfolder.example to myfolderexample ( no 
dots ), them it works as expected. Meaning that it will return false without any 
 [2012-01-04 04:34 UTC]
hmm, I can't no reproduce this if you are sure that "/home/example" exists.
 [2012-12-30 09:28 UTC] support at hostinghood dot com
open_basedir works correctly, tested myself.
 [2013-05-29 12:03 UTC] 19982090 at atn dot ac dot at
i habe experienced the same error.
my basedir is like /home/.sites/123/site346/web and the warning comes up if i try 
to call is_file(..../web/data/foldername)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Jan 28 02:01:24 2021 UTC