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
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Fri Dec 10, 2004 3:03 pm
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
Roja
Tutorials Group
Posts: 2692 Joined: Sun Jan 04, 2004 10:30 pm
Post
by Roja » Fri Dec 10, 2004 3:16 pm
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".
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Fri Dec 10, 2004 3:22 pm
I set the permission of the file to 777 just to test. No luck?.
scorphus
Forum Regular
Posts: 589 Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:
Post
by scorphus » Fri Dec 10, 2004 3:36 pm
Remember, when renaming a file you are changing the content of a directory, thus this directory needs to be writeable too.
-- Scorphus