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?Premkumar Suresh– Premkumar Suresh2021年11月09日 17:19:59 +00:00Commented 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.Amitkumar solanki– Amitkumar solanki2021年11月09日 18:53:51 +00:00Commented 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.Premkumar Suresh– Premkumar Suresh2021年11月11日 16:52:20 +00:00Commented Nov 11, 2021 at 16:52
Explore related questions
See similar questions with these tags.