Page 1 of 1

chmod() - permission denied

Posted: Fri Dec 10, 2004 3:03 pm
by Joe
Why would I get a permission denied error when using chmod() and rename()?. I was thinking perhaps my config files are set incorrectly?.

Regards


Joe

Posted: Fri Dec 10, 2004 3:16 pm
by Roja
If the files are owned by the USER, and not the webserver, and the permissions are not other=w, then you wont be able to.

Think of it this way:

I'm the webserver. I want to change YOUR file. Do I have permission to?

I'm not the user. I'm not in the same group. So, that means I'm "Other" or "World".

Posted: Fri Dec 10, 2004 3:22 pm
by Joe
I set the permission of the file to 777 just to test. No luck?.

Posted: Fri Dec 10, 2004 3:36 pm
by scorphus
Remember, when renaming a file you are changing the content of a directory, thus this directory needs to be writeable too.

-- Scorphus