php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39436 Unable to list (scandir) a shared directory
Submitted: 2006-11-08 17:36 UTC Modified: 2006-11-08 17:56 UTC
From: gianfranco dot pavesi at ergoitalia dot it Assigned:
Status: Not a bug Package: IIS related
PHP Version: 5.2.0 OS: Windows Server 2003 std sp1
Private report: No CVE-ID: None
 [2006-11-08 17:36 UTC] gianfranco dot pavesi at ergoitalia dot it
Description:
------------
I've tried to read the content of a shared remo directory from a web application running under IIS 6.0

It doesn't work !

If I run the same PHP code from a command line on the same server where the IIS is running, using the command "c:\php\php.exe my_php_code.php" ... it works !!!

  

Reproduce code:
---------------
<?php

...

$mypath = "\\\\ergmilftp01\Sinistri_Scanner\Prod" ;

$mylist = scandir("\\\\ergmilftp01\Sinistri_Scanner\Prod") ;

foreach ($mylist as $myfile) {

	echo $myfile."<br />" ;
}

...

?>

Expected result:
----------------
pippo.txt
pluto.txt
paperino.txt

Actual result:
--------------
Warning: scandir(\\ergmilftp01\Sinistri_Scanner\Prod) [function.scandir]: failed to open dir: Invalid argument in D:\TechPortalTest\gsc_prova.php on line 8

Warning: scandir() [function.scandir]: (errno 22): Invalid argument in D:\TechPortalTest\gsc_prova.php on line 8

Warning: Invalid argument supplied for foreach() in D:\TechPortalTest\gsc_prova.php on line 10

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-08 17:46 UTC] tony2001@php.net
Running the code under IIS you're restricted to IIS default user privileges, while running in console you use your own user.
Not PHP problem.
 [2006-11-08 17:56 UTC] gianfranco dot pavesi at ergoitalia dot it
Ok, sorry, I've miss some info

Anonymous User (IUSR_machinename) is disabled on the ISS and I'm using the Integrated Windows authentication.

The error ((errno 22): Invalid argument) does not seams to be a permission error ... I'm confused.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 11 17:01:27 2024 UTC