Problem with PHP copy

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
znewsham
Forum Newbie
Posts: 3
Joined: Wed May 07, 2008 8:29 pm

Problem with PHP copy

Post by znewsham »

Hello.
I am writing an order processing application for a photography website. When an order is made, the client wants all the photographs purchased in that order to be moved to a new folder. He has a website hosted on one server. Then the images hosted on 5 different drives in his office. The drives are called ws1, ws2,ws3, ws4 and orders. The pages that do the copying are located on ws1. I have made the system and it works, copying files from ws2,3,4 to orders. However, when copying from ws1 I get a permission error. Does anyone know why this is. THe destination is always the same, so this is not the problem, and its always the same file that does the copying.

I am totally stumped. Any help would be great.

Thanks.
User avatar
freeformer
Forum Newbie
Posts: 14
Joined: Tue May 13, 2008 1:54 pm
Location: UK

Re: Problem with PHP copy

Post by freeformer »

It's possible that the user that the PHP process is running under isn't the same in both situations.

Are the drives w2, 3, 4 and orders all located on the same machine?
JacobT
Forum Commoner
Posts: 43
Joined: Tue May 13, 2008 11:07 am
Location: Los Angeles, CA

Re: Problem with PHP copy

Post by JacobT »

If you're getting a permission error when copying from the ws1 drive, make sure that folder has the correct permissions for reading by the user PHP or your webserver is running under (as freeformer suggested) and that PHP isn't running in Safe Mode otherwise you may get an open basedir error.

If you can't solve your problem, perhaps paste the exact PHP error you're getting so we have more info to help.

Good Luck
Post Reply