tags:

views:

188

answers:

2

ok so i'm trying to copy file.xml into another location something like copy('file.xml',../../folder/newfile.xml) ; it works just fine on my wamp virtual server but on my real site it doesn't. i thought that is something related to chmod and i changed the file.xml to 0777(with a ftp client).

is there something that i should put in my code to make it right? or what?

A: 

Copy is a pretty straigtforward function. As Mark said, it's perhaps a host issue.

Jason Leveille
and if the my host doesn't give me permision to copy files is there a way to change this with a .htaccess ?
kmunky
@kmunky - if they're disallowing the function, overriding with a `.htaccess`, while maybe possible, would likely be grounds for getting your account killed
warren
i just read the php configuration on my account and it says nothing about copy(), but i still think that this is the only plausible cause. i'll try that function that you pointed me at. thanks
kmunky
ok...so i partially discovered the problem...it's not from copy restrictions...i realized that even that i set my folder access to 0777 when i create it like so mkdir($total_path,"0777"), when i check it's chmod i get a 411 permision...do you have any idea why that happens ? thanks
kmunky
Your mode should not contain quotes. Try mkdir($total_path, 0777);
Jason Leveille
A: 

It might be that you don't have permissions to the folder you are trying to copy to or as mentioned your host doesn't give PHP necessary permissions for copy.

Myles
a forgot to mention, first of all i create the folder that i'm copying the file in, and i create it with a chmod of 0777
kmunky