#41518 [NEW]: file_exists() warns of open_basedir restriction on non-existent file

From: Date: Mon, 28 May 2007 13:38:44 +0000
Subject: #41518 [NEW]: file_exists() warns of open_basedir restriction on non-existent file
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113094@lists.php.net to get a copy of this message
From: ruben dot willmes at emil2001 dot de Operating system: Linux PHP version: 5.2.2 PHP Bug Type: Safe Mode/open_basedir Bug description: file_exists() warns of open_basedir restriction on non-existent file Description: ------------ If open_basedir is active, file_exists(), as well as is_dir() and is_file(), throw an open_basedir warning if you check a non-existent file in a directory mentioned in the open_basedir configuration. The directories used in this case aren't symlinks. The following example describes the situation with is_file(), but you'll get the same result with is_dir() and file_exists(). For a reference please see Bug #24313 http://bugs.php.net/bug.php?id=24313 Sorry if this is a dub, but i didn't found any bugs referring to the actual PHP version Reproduce code: --------------- if (is_file('/var/www/localhost/htdocs/index.phph')) { print "File exists"; } else { print "File does not exist"; } Expected result: ---------------- is_file should return a FALSE and you should read "File does not exist". Actual result: -------------- In addition to "File does not exist", you'll get a warning that open_basedir restriction is in effect: Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/var/www/localhost/htdocs/index.phph) is not within the allowed path(s): (/var/www/localhost/htdocs/) in /var/www/localhost/ htdocs/check.php on line 3 -- Edit bug report at http://bugs.php.net/?id=41518&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41518&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41518&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41518&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41518&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41518&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41518&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41518&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41518&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41518&r=support Expected behavior: http://bugs.php.net/fix.php?id=41518&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41518&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41518&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41518&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41518&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41518&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41518&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41518&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41518&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41518&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41518&r=mysqlcfg

« previous php.bugs (#113094) next »