From: mattj at exitcare dot com Operating system: Windows 2003 Web Server PHP version: 4.3.3 PHP Bug Type: Directory function related Bug description: Problem Accessing Network Shares
Description: ------------ I've looked at the documentation for opendir() and it says: opendir -- open directory handle resource opendir ( string path) It doesn't specifiy exactly what a valid path is, so maybe this isn't a bug and is working as intended, but I don't know. I used the following code to just test opendir() accross a network to a windows share. The computer's name I am trying to access is 'matt', the IP is '192.168.0.6', and the name of the share is 'F Drive'. I tried it with both the UNC and the IP with the proper escaping and they didn't work. I also tried them with forward slashes, didn't work either. The 'F Drive' share on the XP machine PHP is trying to access has Permissions set up to allow read access to 'Everyone', but with the nature of the error, I don't think permissions is even relevant, but I figured I should just mention that in case. Are windows network shares / UNC's not supported by PHP? I couldn't find any documentation on PHP's manual about network shares. They all returned Invalid Argument. Reproduce code: --------------- <?php $dir1 = "\\\\matt\\F Drive"; $dir2 = "\\\\192.168.0.6\\F Drive"; $dir3 = "//matt/F Drive"; $dir4 = "//192.168.0.6/F Drive"; opendir($dir1); opendir($dir2); opendir($dir3); opendir($dir4); ?> Expected result: ---------------- Shouldn't error. No output. Actual result: -------------- Warning: opendir(\\matt\F Drive): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\ExitCareWeb\test.php on line 6 Warning: opendir(\\192.168.0.6\F Drive): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\ExitCareWeb\test.php on line 7 Warning: opendir(//matt/F Drive): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\ExitCareWeb\test.php on line 8 Warning: opendir(//192.168.0.6/F Drive): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\ExitCareWeb\test.php on line 9 -- Edit bug report at http://bugs.php.net/?id=25805&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25805&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25805&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25805&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25805&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25805&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25805&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25805&r=support Expected behavior: http://bugs.php.net/fix.php?id=25805&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25805&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25805&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25805&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25805&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25805&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25805&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25805&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=25805&r=float