parris.varney@ontech.com Posted December 14, 2007 Share Posted December 14, 2007 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 Quote Link to comment Share on other sites More sharing options...
parris.varney@ontech.com Posted December 17, 2007 Author Share Posted December 17, 2007 Nobody has anything? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 17, 2007 Share Posted December 17, 2007 Is this drive on your server or your local machine? PHP can only access disks on the server. Ken Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 17, 2007 Share Posted December 17, 2007 I've never needed to do this, so just throwing a guess out there... have you tried prepending the machine name or domain to the path? PhREEEk Quote Link to comment Share on other sites More sharing options...
parris.varney@ontech.com Posted December 17, 2007 Author Share Posted December 17, 2007 It's a drive on a server, I'm running wamp, and accessing a Win2k server (if that makes a difference). Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 17, 2007 Share Posted December 17, 2007 Did you try: <?php $fileLocation = "O:/Data/"; ?> or <?php $fileLocation = "O:/Data"; ?> Ken Quote Link to comment Share on other sites More sharing options...
parris.varney@ontech.com Posted December 17, 2007 Author Share Posted December 17, 2007 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.