Forum Moderators: phranque

Message Too Old, No Replies

Changing Permissions?

         

FredAt

2:03 pm on Jan 16, 2008 (gmt 0)

10+ Year Member



I am in the process of testing a PHP script that needs to read/write a text file on my server. On my local installation - running Windows - I can do this with no problem whatsoever. However, on my site host - which runs Apache on Linux - I run into "Permission Denied" error. I have been able to get round this for the purposes of my testing by giving "Write" permission to the "Other" user.

However, I have promptly gone and reset that given that I am unsure if this is the right way. I have to admit to being something of a novice when it comes to Users, Groups, Permissions etc.

What is the right approach and where can I read up on it - short of buying a book that may not have the answers. I would much appreciate any help.

phranque

10:22 pm on Jan 16, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i would change ownership of the file so that it is owned by the apache server process owner.
on *nix systems, the chown command is used for this.

FredAt

5:11 pm on Jan 17, 2008 (gmt 0)

10+ Year Member



Thanks! Changing ownership sounds like the right idea. Any idea how I can do it via cPanel?