SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    London
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Folder / directory rights 777, chmod(), update a file

    What can happen if I set folder rights 777 (which is necessary for some PHP Scripts e.g. to update a file) ?
    My first idea was using the function chmod() to change rights for a file to 777, then update the file and then change back to 755 with chmod() - which is not working. Does anybody know why ?
    Can I somehow avoid to set folder rights to 777 when updating a file via a PHP-Script. If not, what would be a safe solution ?
    Thank you *heidi

  2. #2
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    chgrp the directory to whatever is the default group for the web server user, then chmod g+rw the directory will give PHP the rights to update files
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #3
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    isn't 666 usually enough for reading and writing?


Bookmarks

Posting Permissions

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