#50542 [Com]: scandir() cannot open UNC paths since PHP 5.3.1
| From: | bramus at bram dot us | Date: | Fri, 08 Jan 2010 15:32:07 +0000 |
| Subject: | #50542 [Com]: scandir() cannot open UNC paths since PHP 5.3.1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146435@lists.php.net to get a copy of this message | ||
ID: 50542
Comment by: bramus at bram dot us
Reported By: dd at headlineweb dot nl
Status: Assigned
Bug Type: *Directory/Filesystem functions
Operating System: win32 only - W2003
PHP Version: 5.3.1
Assigned To: pajoye
New Comment:
Having the same issue here, cannot access *any* file on an UNC path via
fopen, file_put_contents, etc. Even file_exists returns false.
User has sufficient permissions (impersonate is active) + All worked
fine under PHP 5.2.x (Additionally: even if I set permissions for
"Everyone" to have full access to the given UNC path it will not work).
Running IIS7, PHP is configured as a FastCGI Module.
Previous Comments:
------------------------------------------------------------------------
[2009-12-21 14:49:11] dd at headlineweb dot nl
thanks pajoye,
yes, i use impersonate and the user has access to the share
------------------------------------------------------------------------
[2009-12-21 14:46:39] pajoye@php.net
I will test it once I'm back home after my holidays.
However, I can say that it works just fine, having use this feature
last week. Did you use impersonate? Or are you sure that the user
running php has access to this share?
------------------------------------------------------------------------
[2009-12-21 14:41:33] dd at headlineweb dot nl
Description:
------------
scandir() cannot open UNC paths since PHP 5.3.1 (Running under IIS 6)
I've upgraded from PHP 5.2.11 tot 5.3.1 and then this function does not
work anymore.
this problem i have also with readdir, opendir, & glob.
PHP is configured on a virtual directory, i used the PHP 5.2.11 ISAPI
module and use now the PHP 5.3.1 CGI Module.
I tried following path's:
$dir = "\\\\hdlsrv\\Company\\Documentatie";
$dir = "\\hdlsrv\Company\Documentatie";
$dir = "//hdlsrv/Company/Documentatie";
$dir = "///hdlsrv/Company/Documentatie";
IIS is configured to use 'integrated windows authentication' and
'digest authentication for windows domain servers'.
When a user opens the page, php-cgi.exe is running as the users logon
name.
The user has access to the share.
Reproduce code:
---------------
<?php
$dir = "\\\\hdlsrv\\Company\\Documentatie";
$files = scandir($dir);
print_r($files);
?>
Expected result:
----------------
Array ( [0] => . [1] => .. [2] => Article Ranges [3] => Bezoek
Verslagen [4] => Demo cd [5] => Headline Info [6] => ParcRanges 2008 [7]
=> Software Manuals )
Actual result:
--------------
Warning: scandir(\\hdlsrv\Company\Documentatie) [function.scandir]:
failed to open dir: No such file or directory in K:\Intranet\docs.php on
line 3
Warning: scandir() [function.scandir]: (errno 2): No such file or
directory in K:\Intranet\docs.php on line 3
PHP Warning: scandir(\\hdlsrv\Company\Documentatie) [function.scandir]:
failed to open dir: No such file or directory in K:\Intranet\docs.php on
line 3 PHP Warning: scandir() [function.scandir]: (errno 2): No such
file or directory in K:\Intranet\docs.php on line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50542&edit=1