When attempting to save a product (transferred originally from Mage 1 database) in Magento 2 I am receiving the following error.
Warning: imagejpeg(/var/www/html/pub/media/catalog/product/cache/1/swatch_image/30x20/beff4985b56e3afdbeabfc89641a4582/s/m/small-table_4_2.jpg): failed to open stream: Permission denied in /var/www/html/vendor/magento/framework/Image/Adapter/Gd2.php on line 181
If I visit this location in the file system the image does not exist.
If I look in the product page of admin panel or on the front end I can see no call to this specific image link.
Can anyone please assist?
2 Answers 2
Try to clear Catalog product image cache.
Make sure that /var/www/html/pub/media/catalog/product/cache/ is writable for the Magento user (maybe apache or nginx). Check parent folders also.
Try to delete var/di var/generation var/cache folders too.
Do you use swatch image for products ?
-
No we don't use swatch images for products. I will give that a try and let you know.YorkieMagento– YorkieMagento2017年02月22日 12:58:25 +00:00Commented Feb 22, 2017 at 12:58
-
I get a permissions error when I try and run flush image cache. So I am guessing this will be the cause, and solution to my problem. I will update in due course.YorkieMagento– YorkieMagento2017年02月22日 14:20:06 +00:00Commented Feb 22, 2017 at 14:20
This is resolved by giving all directories in /pub/ folder 775 permissions for the magento user. or we can give 777 permissions
-
1Be sure to meet the permission documentation for security issue : devdocs.magento.com/guides/v2.0/install-gde/prereq/…
vendorapp/etcpub/staticvarFranck Garnier– Franck Garnier2017年02月22日 17:01:17 +00:00Commented Feb 22, 2017 at 17:01
Explore related questions
See similar questions with these tags.