Cannot upload files in WordPress

Some users may receive an error such as:

leftcol ad.png has failed to upload due to an error
Unable to create directory wp-content/uploads/2012/10. Is its parent directory writable by the server?

Typically the "uploads" folder should be perm'd to 777 but to be honest depending on your control panel or PHP settings (suExec, PHP-CGI, or cPanel/Plesk/Webmin) either way for most control panels the folders of and files of the entire site should be set to the user/group that the website is run at.

You can recursively correct the user/group that is assigned with the following command (this has fixed numerous issues for numerous users).

You will need to log in via SSH and it helps to be root.

# chown user:group -Rfv /path/to/website/files/....

You may also like...

2 Responses

  1. shaahin says:

    Tnx mate. 777 worked for me.

    • David says:

      Yeah depending on what control panel is being used (if any), permissions will differ (between Webmin, Plesk, cPanel, no control panel, etc) - Glad this helped you, though!

Leave a Reply

Your email address will not be published. Required fields are marked *