mtorbin Posted December 16, 2008 Share Posted December 16, 2008 Hey folks, I'm primarily a Mac/Unix developer so working in the Windows world is a bit foreign to me. I have a network drive that I want to connect located at: \\myDrive\myDirectory\ When I type that into an address bar in Windows, I connect right away. I can ping the drive with no problems. However, when I type something like the following: $dir1 = '\\\\myDrive\myDirectory\\'; opendir($dir1); I get a "failed to open dir: Invalid argument in ...." error. What am I missing? I've tried researching this online but I haven't found anything that would suggest a solution. Is this an IIS issue? Is this a PHP issue? Any help would be much appreciated. Thanks, - MT Quote Link to comment Share on other sites More sharing options...
rhodesa Posted December 16, 2008 Share Posted December 16, 2008 you are probably running PHP as an Apache service, which means the script is running as a SYSTEM account with no network privileges Quote Link to comment Share on other sites More sharing options...
revraz Posted December 16, 2008 Share Posted December 16, 2008 Are you talking about a physcial drive like D:\mydrive\mydirectory or are you talking about a network UNC like \\myshare\mydirectory ? Quote Link to comment Share on other sites More sharing options...
mtorbin Posted December 16, 2008 Author Share Posted December 16, 2008 Are you talking about a physcial drive like D:\mydrive\mydirectory or are you talking about a network UNC like \\myshare\mydirectory ? It's a network UNC drive \\myshare\mydirectory. - MT Quote Link to comment Share on other sites More sharing options...
mtorbin Posted December 16, 2008 Author Share Posted December 16, 2008 you are probably running PHP as an Apache service, which means the script is running as a SYSTEM account with no network privileges Thanks for the quick response. Where would I look to correct this issue? The script ultimately needs to run as a "cron job" (not sure if the Windows term is the same) from the server where it currently resides. - MT Quote Link to comment Share on other sites More sharing options...
rhodesa Posted December 16, 2008 Share Posted December 16, 2008 if it's going to be run as a Scheduled Task (Window's Cronjob), then you should be fine. while you are testing, use PHP from the command line: php -f /path/to/script.php should work fine that way Quote Link to comment Share on other sites More sharing options...
mtorbin Posted December 16, 2008 Author Share Posted December 16, 2008 while you are testing, use PHP from the command line: php -f /path/to/script.php should work fine that way Cool, I just tried that it it works. However, if I'm running it from a terminal (i.e. command window) via RDP, then I'm running it under my account (not the SYSTEM account) which has privileges and thus it works, right? I've already tested it on a local server and I know it works. My only concern at this point is making the connection between the live server and the script server. - MT Quote Link to comment Share on other sites More sharing options...
rhodesa Posted December 16, 2008 Share Posted December 16, 2008 does the live server run windows too? when you setup the Scheduled Job, you can specify what user to run it as. just make sure the user you specify there has privileges to access \\myshare\mydirectory Quote Link to comment Share on other sites More sharing options...
mtorbin Posted December 16, 2008 Author Share Posted December 16, 2008 Aaron, thanks for your help. Together with the sysAdmin we got it squared away. - MT 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.