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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.