0
votes

I am running a Wordpress installation with Docker (apache) on Linux.
I set the ownership of my Wordpress folder and files to www-data:www-data, or 33:33 (otherwise, I couldn't install plugins or update wordpress from the WP dashboard. I found this solution in many tutorials.)
But because I changed the ownership to www-data, I don't have direct access anymore to the .php files in those folders (so I can't edit them with VS code, or simply modify them in the linux file explorer). How can I fix this?

What I tried:
I tried to add myself to the www-data group, but when I run 'groups' in the terminal, I get "myself adm cdrom sudo dip plugdev lpadmin lxd sambashare docker". I don't see www-data. When I run "grep ^www-data /etc/group", I see "www-data:x:33:myself" though. Weird.
I found a similar question here with a suggested solution to do "sudo chown user:www-data -R" on my WordPress folder, but if I do that, I'm back at the beginning where I cannot add themes, plugins or update wordpress from the WP Dashboard.

enter image description here

1
did you try to change permission (chmod) of the file to 775 after you chown? - ebvjr
Did you log out and log back in after adding your user to the www-data group? - Joni

1 Answers

0
votes

After restarting Linux, my user was finally added to the www-data group (now I could see me as part of this group when typing 'groups' in the console). I then went to add the writing permissions to the www-data group on those Wordpress files, and now, everything is fixed. Thanks for the advice ebvjr and Joni! :)