G
G
glebvvs2018-12-02 00:04:18
ubuntu
glebvvs, 2018-12-02 00:04:18

Why are the rights to the directory with Magento2 content lost?

Good afternoon. I am using ubuntu 16.04. The situation is this. Deployed LAMP in my local area. Installed Magento 2 in the /var/www/ directory. At the first start it asked for permissions. Registered a team

sudo chmod 777 -R /var/www/magento2

after that everything worked as it should. But faced with the fact that after the command
php bin/magento setup:upgrade

all rights fall off and every time you have to register
sudo chmod 777 -R /var/www/magento2

so that everything works as before.
Maybe someone knows what the problem is? Who or what is dumping the rights back to sudo.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2018-12-02
@PavelMonro

Add your user to the apache group, in ubuntu, like www-data, the default group for apache, respectively, php scripts are run from
Or run commands for magento from the user under which apache runs and who has rights to the folder with magento:
sudo -u www-data php bin/magento setup:upgrade

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question