php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67378 file_exists() throws open_basedir restriction in effect.
Submitted: 2014-06-04 06:45 UTC Modified: 2014-06-04 07:17 UTC
From: alexey at ndra dot ru Assigned:
Status: Duplicate Package: Filesystem function related
PHP Version: 5.4.29 OS: Ubuntu 12.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alexey at ndra dot ru
New email:
PHP Version: OS:

 

 [2014-06-04 06:45 UTC] alexey at ndra dot ru
Description:
------------
The warning appears if you try to call file inside the file, for example:  
/home/public_html/test/test.php/.infuso - if test.php is file you have warning but everything is ok if test.php is name of folder.

P.s. PHP Version 5.4.27

Test script:
---------------
<?php
ini_set("display_errors",1);
    if(file_exists("/home/public_html/test/test.php/.infuso")){
        echo "File exists";
    }else{
        echo "File does not exist";
    }
?>

Expected result:
----------------
file_exists should return a FALSE and you should read "File does not exist".

Actual result:
--------------
Warning: file_exists(): open_basedir restriction in effect. File(/home/public_html/test/test.php/.infuso) is not within the allowed path(s): (/home:.) in /home/public_html/test/test.php/.infuso on line 4

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-06-04 07:17 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2014-06-04 07:17 UTC] requinix@php.net
Duplicate of (deep breath):
- bug #52065 Warning about open_basedir restriction while accessing a file as directory
- bug #53041 is_file() and open_basedir
- bug #64573 Confusing open_basedir errors when parent folders are inaccessible
- bug #65211 file_exists() warns of open_basedir on existing file mis-used as directory
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 05:01:28 2024 UTC