Find the answer to your Linux question:
Results 1 to 3 of 3
Hi! On my previous server and on some other hosts, I was able to write to files (for example with PHP) without having to chmod the files first. Now I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2008
    Posts
    4

    Unhappy How NOT to Require CHMOD 755 Permissions To Create, Write and Delete Files with PHP?


    Hi!

    On my previous server and on some other hosts, I was able to write to files (for example with PHP) without having to chmod the files first.

    Now I cannot, and files are required to be chmoded properly so I can write to them.

    I cannot even touch() a file with PHP.

    Is there any way to have this permissions removed?

    I don't want to chmod the all thing, all I want is to change the configurations so I can fwrite() or file_put_contents() normally.

    I's a dedicated un-managed server, so basically any advanced configurations can be done.

    Please help!

    Thank you in advance!

  2. #2
    Just Joined! cheapscotchron's Avatar
    Join Date
    Dec 2008
    Location
    swamps of jersey
    Posts
    68
    There are several ways to accomplish this. A combination of using groups and proper default file permissions should work.

    Set the default file permissions (using umask) you want for the php process owner, then ensure that the process owner is in the same group as the owner of the directory you are trying to write to.

  3. #3
    Just Joined!
    Join Date
    Dec 2008
    Posts
    4
    Thank you very much for your reply cheapscotchron
    I'll try that.

  4. $spacer_open
    $spacer_close

Posting Permissions

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