Hi,
I've been trying to resolve this this issue for a while but I feel totally stuck. I have fully working Magento 2.3.3 store built on my local server. When I transfer it to shared hosting that I'm using I'm facing a very strange issue: catalog product images stop generating on the fly e.g. if I'm importing new products via csv I won't get any pictures for them generated, even though I'm importing correct images. I'm not having this issue if I'm creating a product manually in back office, all the images are generated correctly in this case. Also I found out that if I duplicate a product from an imported one with broken images it generates correct images for original product, but won't show up pictures for the duplicated one.
Of course running image:resize command will generate correct images for all product, but I can't complete it due to shared hosting limitations (command just takes too long and script gets terminated by hosting provider). On the other hand, when I'm importing new products on my local server their images are generated on the fly when I'm browsing catalog on front end and there's no need to run images:resize every time I import a dozen of new products.
Does anyone know what might be causing this issue?
Hello @Miguel_
Honestly Magento 2 is not recommended on shared hosting.
Image resize command generates new cached images to display in frontend.
We had similar issue with one of our client's server and we had to finish that resize command anyhow.
@Miguel_ it is up to you whether you can choose sharing or dedicated server.
But as suggested by @theMageComp sharing is not recommended because it makes your website very slow as compare to another one.
And for this image issue you have to run that image resize command so that magento can cache all the images.
For now there is no solution other than this.
Thanks
Thanks guys, I should have considered this before moving to Magento 2
If anyone facing such issue with nginx server make sure that your image is pass through from get.php file
Below is the rule which you need to mention into nginx configuration file to resolve issue
location ~/media/ {
try_files $uri $uri/ /pub/get.php$is_args$args;
}
OR
location ~/media/ {
try_files $uri $uri/ /get.php$is_args$args;
}