|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50709 file_exists() triggers a warning when path contains file as dir and open_basedir
Submitted: 2010-01-09 18:03 UTC Modified: 2013-02-18 00:34 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: framelio at gmail dot com Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5.3.1 OS: Linux
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: framelio at gmail dot com
New email:
PHP Version: OS:


 [2010-01-09 18:03 UTC] framelio at gmail dot com
I have PHP 5.3.1 installed ad apache module with apache version Apache/2.2.14.

I configured a virtual host with the directive:
php_admin_value open_basedir "/usr/share/pear:/home:/var/www/hosts:/tmp"

The script is into the path: /home/user/web/test.php
and there is a symbolik link from "/var/www/hosts/domain.tld" to "/home/user/web"

When I try to execute a file_exists on a path like this:


Where "test.php" is a FILE and not a DIRECTORY

On all the other cases, no errors.
The special condition is the symbolink link and the filename in the path (like it's a directory).

Reproduce code:
// Where "test.php" is a FILE and not a DIRECTORY, and domain.tld is a symbolink link to another directory.

Expected result:

Actual result:
Warning:  file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/hosts/domain.tld/test.php/testfile.file) is not within the allowed path(s): (/usr/share/pear:/home:/var/www/hosts:/tmp) in /home/user/web/test.php on line 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-24 04:16 UTC]
-Status: Open +Status: Feedback
 [2010-04-24 04:16 UTC]
Please try using this snapshot:
For Windows:

 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 22:05:54 2022 UTC