From:             bart at mediawave dot nl
Operating system: Windows 2000
PHP version:      5CVS-2004-01-14 (dev)
PHP Bug Type:     Filesystem function related
Bug description:  fopen() doesn't work with IIS "Anonymous Access"

Description:
------------
When I enable "Anonymous Access" in IIS, the filesystem functions in PHP5
suddenly aren't able to find my files. 

When I disable "Anonymous Access" (Only "Integrated Windows
Authentication" enabled) everything works perfect.

I use PHP5 with HTTP authentication through the ISAPI DLL. I've given the
IUSR_PCNAME account proper rights everywhere.

I've got "Anonymous Access" enabled on our production server and
everything works fine there as well.

Reproduce code:
---------------
<?
$filename = "template.html";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);

echo $contents;
?>

Expected result:
----------------
The contents of template.html.

- or -

A message saying that I don't have permissions to read the file.

Actual result:
--------------
Warning: fopen(template.html) [function.fopen]: failed to open stream: No
such file or directory in E:\WWW\agri-monitor\test2.php on line 6

Warning: filesize() [function.filesize]: stat failed for template.html in
E:\WWW\agri-monitor\test2.php on line 7

Warning: fread(): supplied argument is not a valid stream resource in
E:\WWW\agri-monitor\test2.php on line 7

Warning: fclose(): supplied argument is not a valid stream resource in
E:\WWW\agri-monitor\test2.php on line 8


-- 
Edit bug report at http://bugs.php.net/?id=26904&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26904&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26904&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26904&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26904&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26904&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26904&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26904&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26904&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26904&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26904&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26904&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26904&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26904&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26904&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26904&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26904&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26904&r=float

Reply via email to