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

Hi @fmon ! Welcome to DevKinsta. I’m happy to help! I have a post here that might help you with the permission issue. Let me know if that works for you.

I’ve found this command in another topic to change permissions, run it and solved the problem:

docker exec devkinsta_fpm chown -R www-data:www-data /www/kinsta/public/

2 Likes

That’s great @fmon !

I had similar issues as described above, after importing a site from Kinsta to the local DevKinsta environment, I wasn’t able to delete a plugin and not able to add a new one, etc.
This solution worked just fine for me!

1 Like

Hi !

I’m posting in this topic because I think it’s related but not sure.

I have created a new site within DevKinsta (my 1st one).
I have a new error (it worked fine up until now) when I try to upload a media

“The uploaded file could not be moved to wp-content/uploads/2021/08.”

Could you help me ?

Thks in advance.

Amelie

Welcome to DevKinsta @amelie ! It does appear related. Try the guide above to and let me know if that helps.

I have tried and I have a big problem : I can’t connect any more to wp-admin, I get 403 error …

Permissions have been reset. 644 is not enough ?

Hi @amelie Could you try running through the steps again? It sounds like something went wrong here.

Hi @michael ,

Problem persists. Seems to run successfully but I still get 403 error (and 500 if I try to display the site).

Microsoft Windows [version 10.0.19041.1165]
(c) Microsoft Corporation. Tous droits réservés.

C:\Users\Amélie>docker exec -it devkinsta_fpm bash
root@c19f13ca9aca:/www/kinsta# echo “IyEvYmluL2Jhc2gKCmZpbGVzPSh3cC1hZG1pbiB3cC1jb250ZW50IHdwLWluY2x1ZGVzKQplY2hvICJSZXNldHRpbmcgZmlsZSBwZXJtaXNzaW9ucywgdGhpcyBtYXkgdGFrZSBhIG1vbWVudC4uLiIKZWNobyAiUmVzZXR0aW5nIG93bmVyc2hpcC4uLiI7CmNob3duIHd3dy1kYXRhOnd3dy1kYXRhIC1SIC93d3cva2luc3RhL3B1YmxpYy8qCgpmb3IgaSBpbiAiJHtmaWxlc1tAXX0iCmRvCiAgZWNobyAiUmVjdXJzaXZlbHkgc2V0dGluZyBwZXJtaXNzaW9ucyB0byA2NDQgb24gJGkuLi4iOwogIGZpbmQgL3d3dy9raW5zdGEvcHVibGljIC10eXBlIGQgLW5hbWUgJGkgLWV4ZWMgY2htb2QgLVIgNjQ0IHt9ICsKZG9uZQplY2hvICJQZXJtaXNzaW9ucyBoYXZlIGJlZW4gcmVzZXQuIjsK” | base64 -d | bash
Resetting file permissions, this may take a moment…
Resetting ownership…
Recursively setting permissions to 644 on wp-admin…
Recursively setting permissions to 644 on wp-content…
Recursively setting permissions to 644 on wp-includes…
Permissions have been reset.
root@c19f13ca9aca:/www/kinsta#

Thank you in advance for your help.

Amélie

@amelie You were right earlier. 644 are good for the files, but 755 for directories. I’ll update the thread above with the new permissions for files and directories.

@michael Many thks for the update. Its works ! (also uploads)

1 Like

Just thought I’d add that the problem is still happening - I am unable to upload a new plugin from a zip file.
I ran the above commands and they seem to have fixed it.

So seems to be an issue when importing a Kinsta site, as a newly created scratch site is ok.

Any fixed.
Cheers
Alan