I am using magento 2.3.2 community edition. While update any setting at backend I am getting error like

Warning: file_put_contents(/var/www/html/ihouzit/var/cache//mage-tags/mage---39a_MAGE): failed to open stream: Permission denied in /var/www/html/ihouzit/vendor/colinmollenhour/cache-backend-file/File.php on line 691

Sometimes to mage MysqlPDO file. Why this happens lot of times. Always I run permission command, then it comes in normal. Any fix solution for this issue?

Same error for bellow file also

var/cache//mage-tags/mage---39a_DB_PDO_MYSQL_DDL): failed to open stream

Thanks in advance.

  • Please set default Magento file and directory permissions Commented Dec 4, 2019 at 9:29
  • yes I have set 777 for vendor and cache folder Commented Dec 4, 2019 at 9:44
  • Please follow this link. Commented Dec 4, 2019 at 9:48
  • I have set , but it reoccur again again..this is the main issue. Commented Dec 5, 2019 at 4:39

2 Answers 2


Set permission 777 to your var, generated and pub folder.

chmod -R 777 pub/*;
chmod -R 777 var/*;
chmod -R 777 generated;

There is two more thread discussing same question #thread1 #thread2.

First i run permission on the necessary folders. Please visit this link for Magento necessary folder permission

After permission i found that the website is on 2 language English and Spanish.

When i run content deploy code

php bin/magento setup:static-content:deploy -f

It is only write en_EN folder and not write in another folder es_ES. So i got the exact code this to write pub/static folder

php bin/magento setup:static-content:deploy en_US es_ES -f

And i got the solution.

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.