|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19395 open_basedir (closing slash does not work)
Submitted: 2002-09-13 12:05 UTC Modified: 2005-01-31 22:42 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: benter at yippi-yeah dot com Assigned:
Status: Closed Package: Safe Mode/open_basedir
PHP Version: 4.2.3 OS: Linux 2.4.16-4GB (SuSE kernel)
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: benter at yippi-yeah dot com
New email:
PHP Version: OS:


 [2002-09-13 12:05 UTC] benter at yippi-yeah dot com
it says:   
When you want to restrict access to only the specified   
directory, end with a slash. For example: "open_basedir =   
We have three test webs:  
Each web has it's own virtual host and open_basedir set to  
it's directory:  
For www1 phpinfo() says:  
safe_mode: On  
open_basedir: /home/www/www1/ (<- closing slash!)  
With test.php in /home/www/www1/html/  
 $parent = dir('/home/www/www102/html');  
I get:  
Warning: SAFE MODE Restriction in effect. ...  
Changing it to read www4's dir:  
 $parent = dir('/home/www/www4/html');  
I get:  
Warning: open_basedir restriction in effect. File is in  
wrong directory ...  
So, the closing slash does not prevent www1's scripts  
accessing www1* scripts via open_basedir. With safe_mode 
deactivated www1 could read www1*'s dirs but not 
www4,www5,www6... dirs. Either the documentation is wrong 
or the slash at the end is ignored? 
Jan-Hendrik Benter  


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-22 13:35 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 23 02:03:36 2021 UTC