简体   繁体   中英

Wordpress files' permissions on Linux

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.

在此处输入图像描述

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: :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM