Support » Fixing WordPress » I changed file permission for uploads

  • 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?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.

    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.

    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.

    Thanks for the reply brufftech.

    Both by blogs are hosted by the same hosting service . 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?

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘I changed file permission for uploads’ is closed to new replies.