During development of a magento 2 site I keep getting permission issues. When I move from modes I get "Cannot change permissions for path.
" Is there something else that I should be doing?
-
Yes, I do agree it is a bit of a pain. What user are you logged in as in the command line? Is this the magento file system owner (not www-data) and does this owner have full acess (read/write/execute)?– tecjamFeb 12, 2016 at 14:15
-
I am logged in as root– Matthew McLennanFeb 12, 2016 at 14:30
-
The M2 setup requires a specific user, not www-data, to be magento system owner. Running any bin/magento command as root will create files and folders as root, which may cause issues. See: devdocs.magento.com/guides/v2.0/install-gde/prereq/… We have a deployment in which we use 'su magento_user -s /bin/bash -c "bin/magento setup:upgrade"' to run the scripts as a specific user– tecjamFeb 12, 2016 at 14:33
1 Answer
The M2 setup requires a specific user, not www-data, to be magento system owner. Running any bin/magento command as root will create files and folders as root, which may cause issues. See: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html
We have a deployment in which we use the following command for example
su magento_user -s /bin/bash -c "bin/magento setup:upgrade"
to run the scripts as a specific user