1

My PHP code looks like this:

$dirpath = "\\\\172.16.111.91\\Data";
$dircheck = is_dir($dirpath);
if ($dircheck) {
    echo "Found";
} else {
    echo "Not Found";
}

If $dirpath is something like "C:/", it works fine, but I've been giving it the UNC path to a remote directory and suddenly it can't find anything.

I've tried exec("NET USE $dirpath $password /USER:$user"); and that doesn't help.

I'm running this on Windows Server 2012 R2, PHP is v5.3, and IIS 8.5. I think this has something to do with IIS's authentication but for the life of me I just can't figure this one out.

  • Check this out: http://stackoverflow.com/questions/1153824/php-access-network-path-under-windows – steven May 19 '15 at 20:37
  • If you look to the right you will see several questions with exactly the same issue – rjdown May 19 '15 at 20:38
  • I've tried looking at those and still nothing. Unfortunately I wasn't able to fix this problem but I was able to find a suitable work-around for what I was doing! – Ethan Neidhart May 20 '15 at 15:12

0 Answers0