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).
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,
Best Answer
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 thevar/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:
Also, remove everything including old generated static files from below path except
.htaccess
file:Now finally to deploy static view files and re-index the indexers. Run the following CLI commands in Magento 2 root directory:
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