#32286 [NEW]: is_readable and file_exists return wrong result

From: Date: Sat, 12 Mar 2005 03:41:10 +0000
Subject: #32286 [NEW]: is_readable and file_exists return wrong result
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-75242@lists.php.net to get a copy of this message
From: joe dot knall at gmx dot net Operating system: Linux PHP version: 4.3.10 PHP Bug Type: Safe Mode/open_basedir Bug description: is_readable and file_exists return wrong result Description: ------------ file_exists() returns FALSE but file exists, is in include_path, open_basedir and safe_mode_include_dir; only happens when safe_mode=On (not so when safe_mode=Off); anyways file can be used with include/require; relative or absolute path and ownership doesn't matter; same problem with is_readable(); './configure' '--prefix=/php' '--infodir=/usr/share/info' '--mandir=/usr/local/man' '--disable-cgi' '--disable-cli' '--disable-ipv6' '--disable-pear' '--disable-short-tags' '--enable-safe-mode' '--with-apxs2=/apache/bin/apxs' '--with-config-file-path=/apache/conf' '--with-mysql=/mysql' '--with-zlib-dir' pear is installed manually; may be a feature, but smarty works that way and I don't know where else to report this (internals/core.assemble_plugin_filepath.php, line 33) Reproduce code: --------------- test script: (/www/htdocs/test.php) <?php $file = '/php/lib/php/file.php'; echo file_exists("$file") ? 'ok' : 'nok'; // echo is_readable("$file") ? 'ok' : 'nok'; echo "<br />\n"; include "$file"; ?> file.php: <?php echo "here I am"; ?> Expected result: ---------------- If file can be included it should exist, isn't it? So output should be: ok here I am Actual result: -------------- nok here I am -- Edit bug report at http://bugs.php.net/?id=32286&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32286&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32286&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32286&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32286&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32286&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32286&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32286&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32286&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32286&r=support Expected behavior: http://bugs.php.net/fix.php?id=32286&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32286&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32286&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32286&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32286&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32286&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32286&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32286&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32286&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32286&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32286&r=mysqlcfg

« previous php.bugs (#75242) next »