plz help me, i'm using apache 2,php 5 and mysql 5 which come with suse 10.1, i got a problem with copy command from php, i can't copy a file to server if the file with same name are exist, but there is no problem if the file was not existed before, anybody can help me?
Can't overwrite file using Copy command
Could be a permissions problem if the existing file is not writable by the Apache user under whom your script is running.
can u tell me how to set the permission to allow read and write for all user to a file when that file was moved/copy to server?
i have set permission to folder that contain the file, but still not working
The file that you are trying to overwrite is propably copied to the server by the normal user(eg. with ftp,ssh)? You have to set the file's permission so that its writable by world or chown it to user that is apache. If you dont have root rights you have to give the file write permission to world(normal user cant chown a file to another user if I remember right).
the file was copied from php using copy() command, i doubt it cause by permission problem, coz i can copy the file to server succesfully if there is no file with same name in server,the only problem that file can't be overwrited in server
Well can you use unlink(delete) on the php side to remove the file? If yes, problem solved If delete doesnt work, you better paste the actual error that it gives.
thanks for the reply cahva, actually i already know my problem can be solved exactly with the solution that you tell,
my greatest point was not how to perform the operation, but why i could'nt performed the copy() to overwrite my file on server since in my local tested computer it works correctly
i just curious if there something wrong in my server configuration (running on suse 10.1) in other hand my local tested computer (running on win xp) works greatly and wasnt encounter the problem that my server had