Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to chmod a directory, chmod() doesn't work

    I want to make a script that CHMOD files for users so they don't need to do it themselves. Now when I tried using
    chmod("path/to/filename", 0777);
    this didn't work, says I don't have permission to do this.
    So I chmod the directory to chmod to 777 and that works but then doesn't that chmod everything in that directory into 777?
    Also I couldn't find a function that chmod directories.
    I would really like it so the user installing this script wouldn't need to chmod anything, or if it had to chmod one thing, make it a file and not a directory.

    what can I do?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by o0katz0o
    So I chmod the directory to chmod to 777 and that works but then doesn't that chmod everything in that directory into 777?

    No - it shouldnt.. it should just chmod the dir.. no files or subdirs within it.
    what you have their should work.. im guessing you just dont actually have permission to do it from http... otherwise - if you had the wrong code.. it would bring you back an error... check it out in your hosts faq


  •  

    Posting Permissions

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