can't copy files

I’m using a PHP script from the command line to copy files from a mapped drive on a remote computer to a folder on the local computer where PHP is running. I get an “Access is denied (code: 5)” error.

When PHP runs from the command line, is it using the same user account it runs with when it runs in the browser?

How can I tell if the access is denied on the remote side or the local side?

What account would need to have read/write permissions set?

Thank you!

What operating system?

Win 2008 R2

Do you mean that you are using PHP’s file UPLOAD command and then trying to move or copy the file to another folder on the server? If so, you need to log into the server and use the CHMOD command to set that one folder to either 775 or 777 depending on your security settings. Sometimes 755 works.

If that is what you mean, try it and let us know…

To log into the server, you can use a FTP client and right-click on the servers folder and change the permissions to allow writing to to it.

Hope that helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service