WordPress.org

Ready to get started?Download WordPress

Forums

I changed file permission for uploads (6 posts)

  1. nishantphotography
    Member
    Posted 1 year ago #

    Hello,

    I was unabel to upload images to a fresh build of wordpress 3.5

    I was getting an error as below:
    "Unable to create directory wp-content/uploads. Is its parent directory writable by the server?"

    While searching through the forum, I found a work around to change the file permission of wp-content folder to 777, and then try uploading. After uploading, it mentioned that I have to change the file permission for wp-content to 755.

    I followed the above method and was able to upload the image. Now I have revert back wp-content folder permission to 755. But the uploads folder it created (and its sub-folders) have permission 777. Is it safe to leave the permission for uploads folder and its directories with this permission?

  2. nishantphotography
    Member
    Posted 1 year ago #

    Also, I notice that using FTP client, now I am not allowed to change the permission of uploads folder from 777 to 755. It says operation not permitted.

  3. nishantphotography
    Member
    Posted 1 year ago #

    Update: I have deleted the uploaded images from the library and deleted the uploads folder using cpanel

    Now, I face the same issue while trying to upload a file. it fails with the following error message:
    "Unable to create directory wp-content/uploads. Is its parent directory writable by the server?"

    The permission of wp-content directory is 755. I see that to upload media, I have change the permission of wp-content to 777 and revert back to 755. but then that creates uploads directory with file permission 777. And isn't that risky?

    I have another WordPress blog with wordpress 3.5. But I don't face that issue there.

  4. brufftech@gmail.com
    Member
    Posted 1 year ago #

    You are correct that it is risky to leave a directory with 777 permissions. This should only be done temporarily, as a last resort.

    The problem that you're experiencing is more of an issue with the server settings that with WordPress itself. I'm guessing that your two blogs are running on different servers or with different hosts. One server has the settings right and the other does not.

    One option that I've found which allows you to have more secure (775) permissions on the upload directory is to make the web user (might be named apache or nobody) a member of the same group as your FTP user. Your web host should be able to make this change for you.

    Another option would be to contact the server admin of the blog that is working and ask them what settings they have for user/group of your account and the web user account, then see if you can get your host to duplicate those settings on server #2.

  5. nishantphotography
    Member
    Posted 1 year ago #

    Thanks for the reply brufftech.

    Both by blogs are hosted by the same hosting service http://www.ewebguru.com . But, maybe they are on different servers.

    I have written to their support team with your suggestions. i will let you know if it works.

    For now, I have created a .htaccess file within the uploads directory to prevent any scripts from running there. Would this control any possible exploits to some extent?

  6. brufftech@gmail.com
    Member
    Posted 1 year ago #

    I'm sure the .htaccess file will help somewhat. It's difficult to say if anything truly prevents exploits 100%.

Topic Closed

This topic has been closed to new replies.

About this Topic