php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24795 UNC Paths using IIS 5.0 and Win2k
Submitted: 2003-07-24 11:19 UTC Modified: 2003-07-27 13:41 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jf dot klug at canfer dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.3.2 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jf dot klug at canfer dot com
New email:
PHP Version: OS:

 

 [2003-07-24 11:19 UTC] jf dot klug at canfer dot com
Description:
------------
I'm trying to open a directory that is on a win2k network share. I've read about UNC path problems, and they all claim to have been fixed in 4.0.6 or somthing like that, but i'm using 4.3.2 and it's still not working. This code was ripped straight form the php documentation: 

<?php
$dir = "/tmp/";

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            print "filename: $file : filetype: " . filetype($dir . $file) . "<br>";
        }
    closedir($dh);
    }
}
?>

Now when I make $dir equal to "//shareddrive/" or "\\\\shareddrive\\" nothing happens, no error or anything. Same thing happens if I map the drive to a letter, like "z:", it still does nothing. It doesn't list the directory, nor does it give an error. The server has full rights to connect with the shared folder, so it's not a permissions thing. It also doesn't work when I use the UNC path for the webserver that this script is running on, but it does work when I just list "./" so I think it's just a problem with UNC paths. The server is running IIS 5.0 and php 4.3.2. Yes there are other UNC path bug reports, but they've all been dissmissed and stated that it's fixed in 4.0.6, but I'm using a way later version then that and it's not fixed, so what gives?

Reproduce code:
---------------
<?php
$dir = "//fileserv/";

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            print "filename: $file : filetype: " . filetype($dir . $file) . "<br>";
        }
    closedir($dh);
    }
}
?>

Expected result:
----------------
Should list all files and folders in that directory.

Actual result:
--------------
A blank page. No error or nothing.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-24 11:44 UTC] wez@php.net
You cannot do "dir \\servername" from the command prompt; you have to use "dir \\servername\sharename".
The same restrictions apply to PHP.
 [2003-07-26 11:27 UTC] jf dot klug at canfer dot com
I've done //servername/sharedfolder and it doesn't work either. I'm puzzled as to why it's not giving me any error at all. I checked the php settings for error reporting, and they were set to show all errors, so what gives?
 [2003-07-26 18:14 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

You need to use something like this:
$dir = "\\\\drive\\dir";
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 03:01:28 2024 UTC