Find the answer to your Linux question:
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. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just 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!?

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    What you're best off doing in that situation is assigning the files the owner that php wil access them as (http or apache)

    Code:
    chown apache:apache /var/www/localhost/htdocs -R
    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:
    chmod 644 /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)
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Just Joined!
    Join Date
    Dec 2004
    Location
    localhost
    Posts
    56
    Says apache:apache is an invalid user.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •