I have an error in a Magento 2 store and I cannot fix it. On homepage appears this:

 Error filtering template: Warning: imagepng(/var/www/domain/pub/media/e**hemes/resized/frontend/e**hemes/slideshow/b/a/image-1.png): failed to open stream: Permission denied in /var/www/domain/vendor/magento/framework/Image/Adapter/Gd2.php on line 181

File permisions are 777 on media and other subdirectories, also php-gd ..installed.

image-1.png can be accessed directly on browser.

Server Centos, Nginx, PHP 7

  • Do not use 777 permissions in a production environment. It leaves your site open to attacks from anyone. It could be an ownership issue. What user owns these files? Commented Oct 10, 2016 at 17:03
  • a user created by me, not root Commented Oct 10, 2016 at 17:13
  • Is your user in the nginx group (or same group as the nginx process)? Commented Oct 12, 2016 at 17:47


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.