1

Recently I have migrated the magento-1 (ver: 1.9.1.1) data to magento-2 (Ver: ver: 2.1.7) fress version using data migration tool. And it working perfectly in our local computer (localhost).

I found an issue after upload it to server m2.hiddencamera.com.au that some product image (thumbnail and in details view) not showing instead it showing blank image (http://m2.hiddencamera.com.au/hidden-cameras?cat=84).

Product image showing in localhost

Then I have removed the cache, reindex, upgrade (setup:upgrade, indexer:reindex, cache:clean, cache:flush) using SSH. Even I have flushed Catalog Images Cache for pregenerated product images files from Dashboard -> System -> Cache Management. But no luck.

After inspecting the blank image that the image (url) are not serving from pub/media/catalog/product/cache/ instead it serving from pub/static/. But in localhost all product image source is pub/media/catalog/product/cache/.

Finally, I have contacted with the hosting support about the issue but, unfortunately they failed to fix the issue. They didn't found any error from error log. They also try to solve the issue using setup:upgrade, indexer:reindex, cache:clean, cache:flush etc but no luck.

I am requesting for help from the experts to resolve the issue.

Regards,

2 Answers 2

0

I think you have not generated the Static View Files. The static view files refer to the files which are not generated dynamically. These files include images, CSS and JS files. These files are located in the pub/static directory of your Magento 2, and some are cached to the var/view_preprocessed directory as well.

The static view files must be written to the Magento 2 file system using the Command-Line Interface (CLI). To do so, first of all delete caches, sessions & old files that are generated before. To delete caches and sessions, navigate to the following paths and delete everything:

MAGENTO2_ROOT > var > cache > *DELETE ALL*
MAGENTO2_ROOT > var > page_cache > *DELETE ALL*
MAGENTO2_ROOT > var > session > *DELETE ALL*
MAGENTO2_ROOT > var > view_preprocessed > *DELETE ALL*

Also, remove everything including old generated static files from below path except .htaccess file:

MAGENTO2_ROOT > pub > static > DELETE ALL EXCEPT .HTACCESS

Now finally to deploy static view files and re-index the indexers. Run the following CLI commands in Magento 2 root directory:

php bin/magento setup:static-content:deploy

php bin/magento indexer:reindex

This might help you and solve the issue. You can also check out the below blog post and try the other solutions too:

Fix Broken Magento 2 Installation

5
  • Hi @Foyyaz, Thanks for your suggestion. I have tried all the process but no luck. Anyway when checking the product cache image directory I found that the image is not generating for most of the product in server but it generating localhost. For that I am trying to re-generate the image using php bin/magento catalog:image:resize. But after starting the process in ssh a warning is showing that; Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file in /vendor/magento/framework/Image/Adapter/Gd2.php on line 65 .
    – Pk Ray
    Commented Jul 28, 2017 at 9:11
  • After google the issue most of the expert saying this problem may be for php memory_limit issue. I have increased the limit 768MB, but still it showing the warning..
    – Pk Ray
    Commented Jul 28, 2017 at 9:14
  • You can also try by increasing max upload size and see if that works. Commented Jul 28, 2017 at 9:24
  • Sorry for late response. I have tested again after increasing the memory limit, but no luck :(
    – Pk Ray
    Commented Aug 1, 2017 at 4:37
  • Think, the problem is for generating the images cache in server.
    – Pk Ray
    Commented Aug 1, 2017 at 4:38
0
>> Give permissions to pub/media folder chmod -R 777 pub/media/
1
  • This solution is not helping Commented Jul 1, 2022 at 7:55

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.