0

I just installed a fresh wordpress installation on my client's server and tried to upload an image, but it is not getting uploaded. Gives me the following error:

Unable to create directory wp-content/uploads/2017/01. Is its parent directory writable by the server?

Can someone guide me how to fix this error?

  • try chmoding the /wp-content/uploads folder 0755. If that does not work, try 0775. If still not good, try 0777 (but talk to your server admin as this raises security issues). You can try to do it using filezilla. – pixeline Jan 10 '17 at 16:27
  • Should I check the option of "Recurse into subdirectories" while changing permissions? – vipworks Jan 10 '17 at 16:39
  • yes, in this case, you should as WP will create a folder for every month and every year, in that "uploads" directory. You want these child folders to be writable to the server too. – pixeline Jan 10 '17 at 16:45
  • 1
    However if you don't want to change the permission to 777 and still resolve the issue, you can turn of the option to stop wordpress from making extra folders based on month/year. – Jack Johansson Jan 21 '17 at 0:13
1

It's usually a permissions error. We used to have these issues on our older servers. As a general rule for file permissions, you should never allow a folder to be "777" (Read/Write/Execute), but the uploads folder on this server, unfortunately, might need it. If you don't know what I'm talking about, please take a read through of Wordpress' guide to Changing File Permissions.

0

This is actually probably an issue within the database file wp_options having the upload directory incorrectly listed. Go into your database, go to wp_options, and make sure the upload_path is blank.

0

If you have SSH access, do the following.

  1. cd into your www folder on your server. Usually /var/www/html
  2. sudo chown -R www-data:www-data site-folder-name

If you don't have access to the console, you should contact your hosting service provider and ask them to do it in your stead.

Good luck :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.