I am getting this error when I try to open to product catalog page in Magento 2.4.3 Custom theme?

Exception #0 (Exception): Warning: include(/var/www/html/vendor/magento/module-catalog/view/frontend/templates/product/view/attribute.phtml): failed to open stream: Permission denied in /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php on line 71

I set permission also using root.

cd /var/www/html/<magento install directory> find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +

find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +

chown -R :www-data . # Ubuntu

chmod u+x bin/magento

Kindly can you please help me with this!

1 Answer 1


It seems the attribute.phtml is not included because of the permission issue. In such a case, I run the below command.

sudo chmod 777 /var/www/html/vendor/magento/module-catalog/view/frontend/templates/product/view/attribute.phtml.

if it works then you need to add a web user to your apache/Nginx web user group. Also please reset permission for attribute.phtml and try to set proper permission again.

You could also move attribute.phtml file to your theme directory to debug the issue.

Hope the above instruction will resolve your issue.

  • Instead sudo chmod 777. Can I give permission with 644 or 755? Commented Nov 9, 2021 at 17:19
  • try first "sudo chmod 777." if it works then reset permission with 644 and 755 and set ownership of attribute.phtml file too. Commented Nov 9, 2021 at 18:53
  • I tried using this..still not working sudo chmod 777 /var/www/html/vendor/magento/module-catalog/view/frontend/templates/product/view/attribute.phtml. Commented Nov 11, 2021 at 16:52

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.