hello guys in my case when I want to run any command like 'bin/magento setup:upgrade && bin/magento cache:clean && bin/magento cache:flush ' or bin/magento setup:di:upgrade , it always shows met his error :

Warning: fopen(/var/www/html/myproject/web/var/cache//mage-tags/mage---a0a_CONFIG): failed to open stream: Permission denied in /var/www/html/myproject/web/vendor/colinmollenhour/cache-backend-file/File.php on line 646

can anyone tell me how to solve this problem please ?

2 Answers 2


Magento told you that you don't have permissions to write in /var/cache folder, please check what are the permission of the /var folder.


And More refer this link :-

Error Warning: file_put_contents(/var/www/html/var/cache//mage-tags/mage---792_CONFIG): failed to open stream: Permission denied

  • Hello it's answer is helpful ?? Commented Apr 11, 2020 at 5:15

You should run this command:

chmod -R 777  var pub generated

Please let me know if it works!

  • it work , but when a get access to a website after setup:upgrade it tells me , permission denied for generate folder Commented Apr 14, 2020 at 9:18

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.