Running PHP 5.2.0 on Apache Windows, I had a problem (likely the same one as described by others) where is_dir returned a False for directories with certain permissions even though they were accessible.
Strangely, I was able to overcome the problem with a more complete path. For example, this only displays "Works" on subdirectories with particular permissions (in this directory about 1 out of 3):
$d = opendir("./albums/mydir");
while(false !== ($f = readdir($d))) {
echo "
";
if(is_dir($f)) {
echo "Works:" . $f . "";
}
}
However, this works properly for all directories:
$d = opendir("./albums/mydir");
while(false !== ($f = readdir($d))) {
echo "
";
$dName = "./albums/mydir/" . $f;
if(is_dir($dName)) {
echo "Works:" . $dName . "";
}
}
I don't understand the hit-and-miss of the first code, but maybe the second code can help others having this problem.