I have a strange issue with opendir (same problem with glob):
$dir = "Y:\\\\foldername\\";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file\n";
}
closedir($dh);
}
}
Y:\ is a network folder with authentication. My webserver name is testweb and this script is called tree.php. Unfortunately my environment is windows based (php 5.2.5 ISAPI, windows 2003 server).
When I open the script from the same machine where IIS is running (http://testweb/tree.php ) everything works fine but if I connect to the same address from another machine (eg my laptop) I get the following error:
Warning: opendir().. failed to open dir. No error IN D:\web\tree.php
It seems a permissions issue but why it is working from the "local machine" and not from outside? How can I fix this?
Thanks for your help!!
check your permissions on that directory.. you can do it using the function called is_readable