I have not been able to upload images to my WordPress site using the media tool from the WordPress admin panel. I’m getting the following error.
“logo512x512.png” has failed to upload.
Unable to create directory wp-content/uploads/2020/01. Is its parent directory writable by the server?
I have gone through a ton of solutions to this problem but not one has worked for me. I am in the windows 2016 server machine. with a MySQL database. I do not have PhP admin not have a Cpanel.
My ftp is working. I am able to get themes and plugins without any problem. Any ideas?
3
Answers
One possible issue is your
chmod
settings for folderwp-content
. You may need to changechmod
for thewp-content
or it’s parent directory to allow the creation of any folder/file and child folder/file within that directory.Depending on which windows application you are using to set the chmod, would determine how this process is undertaken. I use FileZilla and you can simply –
Right Click on
wp-content
, selectFile Attributes
, and setNumeric value: 755
.In addition, have you considered using a third-party webserver like XAMPP?
I had a similar issue with a Google Cloud Engine Instance, with no cPanel, no phpMyAdmin and FTP, on Ubuntu and Apache. And I solved this way:
1. Define upload folders on wp-config.php
Open wp-config.php with nano or vim and add the following code
before this line:
and save it.
2. Change owner
Change to wp-content directory. In my case (use your own path):
Next, change the owner to www-data
Why www-data? In my case, is the name of the apache service account running on my server. You can check the name with:
that comand returns some like this:
as you see, root and www-data. Maybe with windows server the account will be different (tasklist? pslist?), i don’t know how to get it (I never used windows server, sorry). I Hope www-data works for you.
Finally, make sure uploads folder had the right permissions
3. Grant to that user rights to use WordPress
To html or public_html folder (in my case /var/www/html, change it for your own path)
And voilà. I hope this little guide was useful, or at least, give you ideas to solve it!
Well friends said about putting permissions on directories …
But on Windows there is a difference between Linux, what I recommend is to put WP-content (just this folder) as chmod 0777 and so in the current upload folder (2020) as chmod 0777.
That should do it. And even if you see that there is advice to always put 0755 I advise you to leave it specifically in these folders.
Make a backup before any changes and I believe it will help you are managing to upload
a good alternative is every month that WordPress creates a new folder for that month then you change the folder permission to 0755 according to the month ended so it helps Ah you have more confidence in the security issue