cancel
Showing results for 
Search instead for 
Did you mean: 

catalog images cache not generating (m2.3.2)

catalog images cache not generating (m2.3.2)

Hi,

 

I moved my Magento from localhost to shared hosting and have an issue with catalog images - content for pub/media/catalog/product/cache is not being generated. I have 755 (or even 777) permission for everything in media folder, but there's only a couple of files in cache folder and after flushing images cache in admin Magento doesn't generate more images. 

 

What is strange that exactly same system generates all images in cache folder really quickly on my localhost when I'm just browsing the catalog after flushing images cache. 

 

Unfortunately I can't run catalog:images:resize on my hosting since it has 5min limit on processes running in CLI.

 

Did anyone have something similar?

8 REPLIES 8

Re: catalog images cache not generating (m2.3.2)

Hi @Miguel_

Try once the following command:

Memory size issue:
php -d memory_limit = -1 bin/magento catalog:images:resize

Execution time issue:
php -d max_execution_time = -1 bin/magento catalog:images:resize

Try once both together if you face memory issue and execution time issue.
php -d memory_limit = -1 max_execution_time = -1 bin/magento catalog:images:resize


I hope it will work for you!

Re: catalog images cache not generating (m2.3.2)

@Miguel_ 

 

You have already tried catalog:images:resize command from CLI? Did it run successfully or timed out due to 5 minute limit? Sometime Putty session timesout due to which running process from putty also get timed out.

 

You can try few thing to make it working:

1. Put the memory limit in the command and run.

2. If #1 does not work in 5 minutes and your putty/SSH connection time out then the run the command in background. This will keep it working until complete.

3. If #1 and #2 does not working you can create the php file to run the CLI command. Make sure you set the execution time to run the script for decent amount of time. You can use the below URL to create your script.

 

https://magento.stackexchange.com/questions/201470/magento-2-run-php-bin-magento-without-command-lin...

 

If you still have issues then possible permission / server issue. Look into server / Magento logs.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: catalog images cache not generating (m2.3.2)

Hello @Miguel_ ,

As you said your command is not executed because of time limit. So try to execute command by extending time limit
Please try to execute your re-indexing command as :

php -d max_execution_time=8000000 bin/magento catalog:image:resize

If still you face the same issue then execute the command by setting max execution time as infinity by

php -d max_execution_time=-1 bin/magento catalog:image:resize

I hope it will help you. If still you face any issue, please let me know.
If it helps you please give kudos and accept it as solution.
Regards.

Re: catalog images cache not generating (m2.3.2)

Hi all

 

Magento is deployed on shared hosting server, so I have absolutely no control over php memory limit and execution time, so running 

max_execution_time=-1

or

memory_limit=-1 

is just impossible.

 

I solved the issue temporary by running 

catalog:images:resize

on my localhost and then uploading generated images on production server via ftp. Of course this is not a sustainable solution, since cleaning images cache on production will wipe all the pictures. 

Re: catalog images cache not generating (m2.3.2)

HI @Miguel_ ,

Try once with few images only, because there may be different hash for new cache images. If you are uploading only images again. 

Re: catalog images cache not generating (m2.3.2)

@Miguel_ ,

BTW catalog cache shoud be auto generated when you browse product page if you haven't imported products from magento 1.x. 

Check your server permissions once. 

Or execute below command:

sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod u+w {} + && chmod u+x bin/magento


for more info:
https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html

Might be it help you withour resize command. 

Re: catalog images cache not generating (m2.3.2)

I've double-checked and all permissions are correct on server. I'm not sure how uploading only a part of images will help, because even if I resize 100 images and then add another 100 and run resize it's going to resize all 200 images at once, unfortunately there are no keys or options for this command. 

Re: catalog images cache not generating (m2.3.2)

@Miguel_ 

If you have less number of images then you can resize all images and upload on server, 

I have only doubt that Hash may create problem.