#50542 [Asn->Fbk]: scandir() cannot open UNC paths since PHP 5.3.1
| From: | pajoye@php.net | Date: | Wed, 20 Jan 2010 11:49:15 +0000 |
| Subject: | #50542 [Asn->Fbk]: scandir() cannot open UNC paths since PHP 5.3.1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146813@lists.php.net to get a copy of this message | ||
ID: 50542
Updated by: pajoye@php.net
Reported By: dd at headlineweb dot nl
-Status: Assigned
+Status: Feedback
Bug Type: *Directory/Filesystem functions
Operating System: win32 only - W2003
PHP Version: 5.3.1
Assigned To: pajoye
New Comment:
Do you use DFS?
Previous Comments:
------------------------------------------------------------------------
[2010-01-20 11:43:19] blc at 3ds dot com
I have exactly the same problem since I moved from PHP 5.2 to 5.3.1
I have it using PHP in command line too when reading remote files
through UNC path AND through drive: path.
Here is a sample code:
====================================================================
<?php
error_reporting(E_ALL);
$file="intel_a/RebasingDrop1.txt";
echo "CWD=".getcwd()."\n";
echo "FILE=$file\n";
// No permission problems to access the file
echo
ls -l $file."\n";
echo head $file."\n";
// file_exists don't see it
echo (file_exists($file)?"file $file EXISTS":"file $file not
found")."\n";
// opening it always fail
echo (fopen($file,'r')===FALSE?"Open FAILED":"Open
worked")."\n";
echo (file($file)===FALSE?"File FAILED":"File worked")."\n";
echo (file_get_contents($file)===FALSE?"file_get_contents
FAILED":"file_get_contents worked")."\n";
?>
====================================================================
Here is the result when running the script from W: (which is mapped on
\\server\share)
====================================================================
CWD=W:\CXR20rel\BSF
FILE=intel_a/RebasingDrop1.txt
-r-xr-xr-a 1 DS\BSFR DS\Domain+Users 6751 Oct 7 2002
intel_a/RebasingDrop1.txt
CATSYSPROXY.DLL
CATAPPLICATIONFRAME.DLL
JS0GROUP.DLL
JS0SPEXT.DLL
CATSYSMULTITHREADING.DLL
CATSYSALLOCATOR.DLL
JS0FM.DLL
CATINFINTERFACES.DLL
CATSYSCOMMUNICATION.DLL
CATAUTOITF.DLL
file intel_a/RebasingDrop1.txt not found
Warning: fopen(intel_a/RebasingDrop1.txt): failed to open stream: No
such file or directory in E:\NoSave\DepsGraph_V7\release\bug.php on line
12
Open FAILED
Warning: file(intel_a/RebasingDrop1.txt): failed to open stream: No
such file or directory in E:\NoSave\DepsGraph_V7\release\bug.php on line
13
File FAILED
Warning: file_get_contents(intel_a/RebasingDrop1.txt): failed to open
stream: No such file or directory in
E:\NoSave\DepsGraph_V7\release\bug.php on l
ine 14
file_get_contents FAILED
====================================================================
Here is the result when running the script from \\server\share
====================================================================
file intel_a/RebasingDrop1.txt not found
Warning: fopen(intel_a/RebasingDrop1.txt): failed to open stream: No
such file or directory in E:\NoSave\DepsGraph_V7\release\bug.php on line
12
Open FAILED
Warning: file(intel_a/RebasingDrop1.txt): failed to open stream: No
such file or directory in E:\NoSave\DepsGraph_V7\release\bug.php on line
13
File FAILED
Warning: file_get_contents(intel_a/RebasingDrop1.txt): failed to open
stream: No such file or directory in
E:\NoSave\DepsGraph_V7\release\bug.php on l
ine 14
file_get_contents FAILED
====================================================================
------------------------------------------------------------------------
[2010-01-09 08:47:16] dd at headlineweb dot nl
The server where PHP is running has RDP enabled, but our system
administrator does not give permission.
if you want to do some test, maybe i can do the tests for you?
BTW: the call is as follows
Client --HTTP--> W2003 Server --UNC--> Another W2003 Server
------------------------------------------------------------------------
[2010-01-08 19:57:53] bramus at bram dot us
pajoye,
I can provide you with an FTPS/WEB account on the server so that you
can run some test files on it; I hope that's sufficient enough (or at
least "a start") as I can not give you full access (viz. RDP access w.
Admin privileges) to the server.
Regards,
Bram.
------------------------------------------------------------------------
[2010-01-08 16:49:34] pajoye@php.net
It works just fine here, using WS03 as server (where the UNC path is)
or client (fetching from).
If one of you can give me a remote access to debug, I could help. But
I'm not able to reproduce this problem using any of the tests system I
use.
------------------------------------------------------------------------
[2010-01-08 15:32:06] bramus at bram dot us
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.
------------------------------------------------------------------------
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/50542
--
Edit this bug report at http://bugs.php.net/?id=50542&edit=1