Jump to content

opendir on mapped network drive


Recommended Posts

Hello all,

 

I've been at this road block for far too long: I can't seem to open a directory not on my local file system using PHP's opendir() function.  I definitely have access to this directory, it's mapped as my "O:" drive and I'm not prompted for a password when I open it via Windows.  I've been digging through the internet looking for anything to help.

 

Here's the error (well warning) message:

Warning: opendir(\\Ontech\Data) [function.opendir]: failed to open dir: Invalid argument in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\scrips\dataLoad.php on line 19

 

Here's the code:

<?php
        error_reporting(E_ALL);
        ini_set('display_errors', '1');

$fileLocation = "\\\\Ontech\\Data";
$dirHanlde = opendir($fileLocation);

while( $file = readdir($dirHanlde) )
{
	echo $file . '<br>';
}
?>

 

Note that for $fileLocation I've tried

$fileLocation = "O:\\Data\\";

$fileLocation = "file:///OnTech/Data/";

$fileLocation = "file://OnTech/Data/";

$fileLocation = "file://OnTech/Data";

$fileLocation = "\\\\Ontech\\Data\\";

 

The remote computer is set to allow access from my account, my computer and (for now) anonymous users.  Also, I've tried to set my Apache service to use every login I can think of.

 

Any help is appreciated, if even a link so I can "read the flippin' manual".

 

Thanks in advance,

Parris

Link to comment
Share on other sites

Yea...

 

I've found a reference that sounds promising, but I'm not entirely familiar with what they're talking about.  This might be my

 

problem:SMBsrvr doesn't allow nullSession...

but why WEBsrvr tries to connect using nullSession ?

because Apache is running as LocalSystem

 

The article is at http://bugs.php.net/bug.php?id=25805

 

Are you familiar with this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.