From: Operating system: Windows Server 2003 PHP version: 5.3.3 Package: Filesystem function related Bug Type: Bug Bug description:Error using relative paths are used with *only* Read permissions
Description: ------------ Running PHP Version 5.3.3 (FastCgi, non-thread safe) on IIS6/Windows Server 2003. All file functions give error when relative paths are used and with *only* Read permissions on the folder. e.g. file_get_contents('./path/file.txt'); The above gives: Warning: file_get_contents(./path/file.txt): failed to open stream: No such file or directory If you give the full path to the same file it works fine. i.e. the follow works: file_get_contents('C:/full/path/file.txt'); If you add "List Folder Contents" permission to the folder it starts to work with relative folders as well. I am guessing the when relative paths are used php tries to get some information about the current folder which fails as the "List Folder Contents" is not given. There is no need to "List Folder Contents" just to read a file (even if the path is relative). This bug has been reported before but not fixed: http://bugs.php.net/bug.php?id=50163 Note: I had php (5.2) running as ISAPI before and didn't have this problem. So it seems to be specific to non-thread safe version. Test script: --------------- file_get_contents('./path/file.txt'); Expected result: ---------------- No error Actual result: -------------- Warning: file_get_contents(./path/file.txt): failed to open stream: No such file or directory -- Edit bug report at http://bugs.php.net/bug.php?id=53011&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53011&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53011&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53011&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53011&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53011&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53011&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53011&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53011&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53011&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53011&r=support Expected behavior: http://bugs.php.net/fix.php?id=53011&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53011&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53011&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53011&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53011&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53011&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53011&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53011&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53011&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53011&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53011&r=mysqlcfg