ID: 25805 User updated by: mattj at exitcare dot com Reported By: mattj at exitcare dot com -Status: Feedback +Status: Open Bug Type: Directory function related Operating System: Windows 2003 Web Server PHP Version: 4.3.3 New Comment:
I redid the share to be called 'fdrive'. Then updated my script accordingly: <?php $dir1 = "\\\\matt\\fdrive\\"; $dir2 = "\\\\192.168.0.6\\fdrive\\"; $dir3 = "//matt/fdrive/"; $dir4 = "//192.168.0.6/fdrive/"; opendir($dir1); opendir($dir2); opendir($dir3); opendir($dir4); ?> But I still get: Warning: opendir(\\matt\fdrive\): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\ExitCareWeb\test.php on line 6 Warning: opendir(\\192.168.0.6\fdrive\): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\ExitCareWeb\test.php on line 7 Warning: opendir(//matt/fdrive/): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\ExitCareWeb\test.php on line 8 Warning: opendir(//192.168.0.6/fdrive/): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\ExitCareWeb\test.php on line 9 Previous Comments: ------------------------------------------------------------------------ [2003-10-10 11:39:33] [EMAIL PROTECTED] Try renaming those shares not to have that space in them, for example 'F Drive' -> 'F_Drive'.. ------------------------------------------------------------------------ [2003-10-10 09:17:42] mattj at exitcare dot com It is not security. I went to the Sharing tab and clicked the Perissions button for the F Drive Share. I gave Everyone full control. I also went to the Security tab and set Everyone to full control. Applied the changes, reran the script. Exact same result. ------------------------------------------------------------------------ [2003-10-10 07:03:46] [EMAIL PROTECTED] "To anyone who needs to use UNC mapped drives with OpenDir(), if you are having a problem with OpenDir() reading the directory, check your permissions for the share on the host machine. Start with giving full permission to everyone (which should work fine) and then back accessability until you have a problem." from bug #22153 ------------------------------------------------------------------------ [2003-10-09 13:04:54] mattj at exitcare dot com Looks like it yields the same results. <?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); ?> 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 ------------------------------------------------------------------------ [2003-10-09 12:32:58] [EMAIL PROTECTED] MSDN docs on FindFirstFile (the win32 API that underlies opendir) state: ----- ... Similarly, on network shares, you can use an lpFileName of the form "\\server\service\*" but you cannot use an lpFileName that points to the share itself, such as "\\server\service". To examine any directory other than a root directory, use an appropriate path to that directory, with no trailing backslash. For example, an argument of "C:\windows" will return information about the directory "C:\windows", not about any directory or file in "C:\windows". An attempt to open a search with a trailing backslash will always fail. ----- So, try it with a trailing backslash. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/25805 -- Edit this bug report at http://bugs.php.net/?id=25805&edit=1