Results 1 to 3 of 3
So I have my debian httpd server working. The problem is, php cannot write to files. I can "chmod o+rw" but it's annoying to have to do that to everything. ...
- 02-19-2007 #1Just Joined!
- Join Date
- Dec 2004
- Location
- localhost
- Posts
- 56
Web server permissions!
So I have my debian httpd server working. The problem is, php cannot write to files. I can "chmod o+rw" but it's annoying to have to do that to everything. Is there a way I can just give php permissions to edit files!?
- 02-20-2007 #2
What you're best off doing in that situation is assigning the files the owner that php wil access them as (http or apache)
assuming the webroot is /var/www/localhost/htdocs. This will assign all files in there the owner user apache and the owner group apache. Then assign the permissions accordingly...Code:chown apache:apache /var/www/localhost/htdocs -R
This will assign rw permissions to the apache user, and read to everyone else, except others in the apache group (which shouldn't be anyone else anyway)Code:chmod 644 /var/www/localhost/htdocs -R
"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 04-30-2007 #3Just Joined!
- Join Date
- Dec 2004
- Location
- localhost
- Posts
- 56
Says apache:apache is an invalid user.


Reply With Quote
