SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist Jhorra's Avatar
    Join Date
    Sep 2004
    Location
    Phoenix, Az
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem when using mkdir

    I have an applicaiton that creates folders for groups, but when it creates the folder using a command like the following mkdir($folder, 0777);

    No one can edit or do anything with the folder. When you go in through FTP and try to change the permissions on it, it says permission denied.

    I talked with our host, and they said the owner of the file was screwed up. Is there something I'm missing, or a setting that needs to be changes to fix this?

  2. #2
    SitePoint Member rfresh's Avatar
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could be several things but first what language are you using to do this? PHP?

    Here are my suggestions:

    1. Does your script have root rights? I got tangled up in this in that my script that was running didn't have the proper rights to do that. You'll need your host's help in making sure your executing script is running as root.

    2. Try just creating the folder with it's default rights and then in a second step, set the 777 permissions on it.
    RalphF
    Domains & $4.99 Web Hosting
    http://www.GoldRushWebHosting.com

  3. #3
    SitePoint Evangelist Jhorra's Avatar
    Join Date
    Sep 2004
    Location
    Phoenix, Az
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is PHP. It's a dedicated server, how do I give the script root permissions?

  4. #4
    SitePoint Member rfresh's Avatar
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was on a shared server and the hosting provider made some changes so my script would run at the correct permissions level. Do you do all of your own work on your server or do you have managed hosting?
    RalphF
    Domains & $4.99 Web Hosting
    http://www.GoldRushWebHosting.com

  5. #5
    SitePoint Evangelist Jhorra's Avatar
    Join Date
    Sep 2004
    Location
    Phoenix, Az
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was able to fix it by creating the file first, then setting the server permissions.

  6. #6
    SitePoint Member rfresh's Avatar
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool
    RalphF
    Domains & $4.99 Web Hosting
    http://www.GoldRushWebHosting.com

  7. #7
    SitePoint Enthusiast Dunkel's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jhorra View Post
    I was able to fix it by creating the file first, then setting the server permissions.
    yes thats the way it is solved

  8. #8
    Grumpy Minimalist
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't run your script as root. If you need to give your script permissions, just modify the permissions for the PHP user. If you run PHP as root, just remove any other security restrictions you have enabled -- they aren't doing any good anyway.

    Running PHP as root is like giving a user full access to PayPal's database so that they can retrieve their e-mail address.


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
  •