Copy Remote Files Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CMangano
Forum Newbie
Posts: 3
Joined: Wed Feb 02, 2011 8:38 pm

Copy Remote Files Error

Post by CMangano »

We are currently running Apache on Windows and we have a process that copies a PDF file from a remote virtual directory (\\xxx.xxx.xxx.xxx) to our web server and everything works fine.

We would like to switch to running our site in IIS rather than Apache on windows. We cloned our current web server to an other VM share and now this copy process does not work. Our configuration is IIS6, FastCGI, CakePHP and PHP 5.3. The error we get is function copy: Failed to open stream: Invalid argument. The block of code is:

copy($remotepath, $localpath);

I am thinking it may be related to the permissions of the IUSR account on IIS but cannot figure out what is wrong. Does anyone have experience with copying remote files this way using IIS?

Hopefully I put in all the necessary info, but if you need me to expand on anything or need more information let me know.

Thanks,
Chris
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Copy Remote Files Error

Post by requinix »

I don't think you'd get an "Invalid argument" error. More like an "Access denied". But it's worth checking the permissions - they do have to be set correctly anyways, it's just that you might not have encountered that error yet.

Double-check your $localpath value.
CMangano
Forum Newbie
Posts: 3
Joined: Wed Feb 02, 2011 8:38 pm

Re: Copy Remote Files Error

Post by CMangano »

That is the error that is printed to the screen. We have everyone set to full control for testing purposes on both directories and it still won't copy. Is there something that needs to be turned on in IIS that we may be missing?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Copy Remote Files Error

Post by John Cartwright »

You will have to add all the neccesary IIS user groups to the folder your trying to write to.
CMangano
Forum Newbie
Posts: 3
Joined: Wed Feb 02, 2011 8:38 pm

Re: Copy Remote Files Error

Post by CMangano »

Thanks John but I added IIS_WPG and IUSR accounts with full control and still getting the same thing. On the server running apache we upgraded it to the latest version and we had to have the service run as our network admin account for this process to work which is why I suspect it may be a setting within IIS.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Copy Remote Files Error

Post by John Cartwright »

CMangano wrote:Thanks John but I added IIS_WPG and IUSR accounts with full control and still getting the same thing. On the server running apache we upgraded it to the latest version and we had to have the service run as our network admin account for this process to work which is why I suspect it may be a setting within IIS.
Ah.. then I don't know, sorry. Just another reminder on why I avoid IIS like the plague :D
Post Reply