0

So on the setup mentioned in the title, I want to confirm how the user should be for command line. Using the default setup there is a user "nginx" that is used for php-fpm and for nginx.

Should that user "nginx" be used for composer install and updates, as well as php bin/magento commands? So I would log into SSH as that user?

I tried making all the files/folders owned by nginx:nginx and creating another user and putting them in the same group as "nginx", logging in as that new user and then running the php bin/magento commands like clear cache but it gives errors like cache is not writable (even though it is for nginx user).

I have already reviewed the docs https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-sys-perms-over.html but this is still not clear to me

0

it is very simple:

  • nginx - only read files
  • php-fpm - read and write files

you have files access as user:group:other

chmod for folders 2770 for files 660

:other dont have to access your files at all.

usually nginx and php-fpm have different user names.

so you need to change your permissions to allow nginx read and php-fpm read write.

if you add new user, it will be in :group: make sure group have write access also.

...

p.s. but better do not change anything, do not mess with user groups and do not move anyone to any group, just change access right with ACL settings, easy to add/remove users with more precise config:

http://manpages.ubuntu.com/manpages/bionic/man1/setfacl.1.html

| improve this answer | |

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.