After WP transfer, unable to upload new content

Posted May 3, 2015 14.2k views

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?


1 comment
  • I’ve solved this by creating folders manualy:
    uploads > 2015 > 05

    And adding them 777 rights (via FTP: right click on file > file permissions):
    group permissions > check
    public permissions > check
    number value = 777
    expand to subfolders


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.

Submit an Answer
3 answers

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

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.