1

May I know the permission for the Magento user to run the cmd SSH/putty. I had checked the Magento documentation but I can't understand for which file need to give 777 and which files need to change the permission. Till now I working on sudo su mode only. And how to handle the permission in production and sandbox.

2 Answers 2

1

You should set as bellow recommended Permissions.

cd <your Magento install dir>

For files 644 : find . -type f -exec chmod 644 {} \;

For Directory 755 : find . -type d -exec chmod 755 {} \;

For var folder 777 : find ./var -type d -exec chmod 777 {} \;

For pub/media folder 777 : find ./pub/media -type d -exec chmod 777 {} \;

For pub/static folder 777 : find ./pub/static -type d -exec chmod 777 {} \;

For app/etc folder 777 : chmod 777 ./app/etc

For app/etc .xml file 644 : chmod 644 ./app/etc/*.xml

chown -R :<web server group> .

chmod u+x bin/magento

0

I recommended following the Adobe dev-docs.

Set file permissions

  1. cd /var/www/html/
  2. find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
  3. find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
  4. chown -R :www-data . # Ubuntu
  5. chmod u+x bin/magento

Reference: https://devdocs.magento.com/guides/v2.4/install-gde/composer.html

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.