4

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?

3
  • 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)?
    – tecjam
    Commented Feb 12, 2016 at 14:15
  • I am logged in as root Commented Feb 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
    – tecjam
    Commented Feb 12, 2016 at 14:33

1 Answer 1

3

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.