3

I keep having to enter permission commands every time a i do a grunt clean and exec. I'm constantly getting a white page with errors, either Class doesn't exist, can't create directory or permission denied.

Anyone got any ideas what i might be doing wrong?

1
  • Are you use grunt for compilation ? Commented Jul 28, 2016 at 17:34

2 Answers 2

2

You are most likely running into issues because you are uploading or processing things as a different user from the one Apache (or nginx/php) runs as. PHP can't write those files because of the differing user and file permissions, and so you get the errors.

If you're doing anything as root, fix that first. Don't.

Otherwise, you might try putting your user and the Apache user in the same group, and setting that group on all Magento files and directories.

See here for recommended permissions setup in Magento 2.x:

if running as root:

su USER -s /bin/bash -c "MAGENTO COMMAND"

to change the owner:

chown -R user:user *
2
  • Thats great thanks! How do I set up a new user?
    – Mark
    Commented Jul 29, 2016 at 8:22
  • Sorry being stupid but wht goes in "Magento command"?
    – Mark
    Commented Jul 29, 2016 at 9:48
0

Could you provide step by step instructions on how to resolve this?

I upload theme changes via FTP as root and constantly have to redo permissions on my server using the following command:

find . -type d -exec chmod 777 {} \; && sudo find . -type f -exec chmod 666 {} \; && sudo chmod u+x bin/magento

Thanks, Nick

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.