Report this

What is the reason for this report?

After WP transfer, unable to upload new content

Posted on May 3, 2015

I’m receiving this error from WP when attempting to upload. Any idea or direction on how to amend this issue? Could this be a permissions issue, if so, how do I go about fixing it?

“Screen Shot 2.png” has failed to upload due to an error Unable to create directory wp-content/uploads/2015/05. Is its parent directory writable by the server?

Thanks!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Ok I have solved this …

In the WP Dashboard … go to Settings / Media

After I had transferred my site to a different server, the old location for media files was in there. So just remove the entry so it defaults … and hey presto … it’s fixed.

Yes it is a permission issue. Login to your Droplet via SSH as the root user and execute the following command:

chown -R www-data:www-data /var/www

To expand on the answer provided by @jesin , what chown does is simply change ownership. The -R tells chown to recursively change ownership of all files & directories in the path specified, starting from the endpoint and ending when there’s nothing more to change.

Using his example,

chown -R www-data:www-data /var/www

… starting with www, all files & directories will now be owned by the user:group www-data. In the event you don’t want www to be owned by this user and group, you could use:

chown -R www-data:www-data /var/www/*

In most cases, I keep the first two directory locations owned by root or another non-privileged user (better option) to prevent directory traversing by other system users.

If you’re hosting your content in another directory, simply swap /var/www/ with the system path you’re using. From the CLI, you can get the full path by using:

echo $PWD

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.