Hi folks. Sorry about this extremely lame question, but I'm having some serious problems and I don't know what to do.
Scenario: (2) Windoze 2003 Servers running IIS 6 & PHP 5.0.4. There is no PDC.
I'm trying to use this script to display the contents of a network share on server A from a PHP install on server B. The purpose of this script is for troubleshooting. It's meant to show that, yes, you can connect to a network share on a remote server and see files and directories there. This is the script:
<?php
ini_set ('display_errors', 1);
error_reporting (E_ALL);
$folder=dir("//<servername>/<share>/<folder>");
while($folderEntry=$folder->read()){
echo $folderEntry."<br>";
}
$folder->close();
?>
Unfortunately, all I get is this error message:
Warning: dir(//WSERVER.WoodWing.local/Public) [function.dir]: failed to open dir: Invalid argument in D:\Content\wwwroot\phptesting\Foldertest.php on line 6
Fatal error: Call to a member function read() on a non-object in D:\Content\wwwroot\phptesting\Foldertest.php on line 8
Interestingly enough, if I edit the script to look for a network share on the same server (i.e. run the script on server A looking at the address //servera/share/folder) it works. If I run that script on server B, with the same address (//servera/share/folder) it doesn't work. That seems to point to permissions problems, but I just don't know.
I've set the permissions on the share to allow Everyone access. I've even tried changing the identity of the application pool for the site to Local System from Network Service thinking that the identity was preventing access to the network, but that also doesn't work.
Can someone give me some pointers to figure this out? All I want to do is verify that I can connect to a folder on a remote network share and display the contents. Any help would be greatly appreciated.
Thanks!
-Victor