WordPress.org

Forums

What permissions for upload folder ? (5 posts)

  1. _mf_
    Member
    Posted 8 years ago #

    Hello,
    I'd like to know what permissions are needed for the file upload directory in WP. It's mentioned in the Wiki it has to be 766 but I'm not comfortable with assigning such permissions to a folder permanently in a shared hosting environment I will have to use.
    Is there any other way of doing this (other than setting the permissions manually each time I upload!) ?
    I think this should be part of the installation instructions on the Wiki.
    Thanks for any comments on this.

  2. chiensavant
    Member
    Posted 8 years ago #

    Haha.. I mean, if your told to put permission 766... and if you don't... don't expect it to work :)
    Why don't you restrict the upload facility to admin only ? You'll only have one person to control : yourself.

  3. _mf_
    Member
    Posted 8 years ago #

    File permissions has nothing to do with the admin upload capabilities. If I restrict uploads to only the admin, the directory still has to be 766 which leaves it open to other manipulations (like file-replacement by other users on the same server).

  4. dunxd
    Member
    Posted 8 years ago #

    The upload is done through PHP so the directory has to be writeable by the user PHP (or the web server PHP is built into) runs as - often web or nobody.

    If you know the username you can chown the folder to it, or add the user to the folder's group.

    If you are unable to do this for any reason then your only bet will be to chmod to 766.

  5. dunxd
    Member
    Posted 8 years ago #

    You can find out the user PHP runs at (at least as an Apache extension) by looking at the output of phpinfo() - it is in the Apache section under user/group.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.