ID:               37556
 User updated by:  phpdotnet at ericmarques dot com
 Reported By:      phpdotnet at ericmarques dot com
 Status:           Open
 Bug Type:         Safe Mode/open_basedir
 Operating System: FreeBSD 5.4
 PHP Version:      5.1.4
 New Comment:

Same problem with other functions too like file_get_contents.

Only happens where the file being performed on is in a sub folder of
the script being run.


Previous Comments:
------------------------------------------------------------------------

[2006-05-23 02:48:15] phpdotnet at ericmarques dot com

Description:
------------
file_exists does not properly resolve symlinks before applying
open_basedir on "include" scripts.

in my situation
/home is a symlink to /data/home

open_basedir is set to /home/ericmarq/
apache documentroot is set to /home/ericmarq/public_html

Server running cPanel, apache 1.3

This did not happen in php 4.4.2, only happened after upgrade to 5.1.2

Reproduce code:
---------------
-- test1.php --
<?php
include("test2.php");
?>

-- test2.php --
<?php
if
(!file_exists("/home/ericmarq/public_html/SUBDIR/does.not.exist.html")){
print "no";
}
?>

Expected result:
----------------
no

Actual result:
--------------
Warning: file_exists() [function.file-exists]: open_basedir restriction
in effect. File(/home/ericmarq/public_html/SUBDIR/does.not.exist.html)
is not within the allowed path(s): (/home/ericmarq/) in
/data/home/ericmarq/public_html/test2.php on line 2
no


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37556&edit=1

Reply via email to