Magento not generating images in cache for some stores

16,457

Solution 1

The issue here is that each time you clear your cache or add a new image, Magento wants to create/add directories as the "apache" user, which prevents it from writing the generated images upon loading a page.

If you run this from the root of your install each time you visit the different pages in Magento (cart, product detail page, main page), you should be ok. Other than that, I'm still looking for a fix:

chown -R correctuser:correctgroup media/*

That should do it.

Solution 2

Set up the php memory limit to something like 256 MB ... it is because the server does not have enough memory to properly manage the whole cache rebuild (flush)

Solution 3

Please try the following via ssh from your site root. This brought back images and cache images that were previous missing.

chmod -R 777 media

Solution 4

I have exactly the same issue i solved the problem by deleting the "cache" folder under .../media/catalog/product/

I dont know if it will be a durable solution but it works for now. Note that I had to flush all magento caches and refresh several times my pages to see the changes. Hope it will help someone.

Share:
16,457
Frank Groeneveld
Author by

Frank Groeneveld

Founder of Webindie, a Dutch company building a SaaS product in Ruby on Rails

Updated on June 04, 2022

Comments

  • Frank Groeneveld
    Frank Groeneveld about 2 years

    I'm using Magento 1.5 with 3 different stores (same products, though targetted at different audiences etc). For one of the stores (the second store that was added), the small_images, thumbnails etc are generated in the cache directory. For the others, the images are not generated (although the directory structure is, so the permissions are set correctly). Anybody know if this is a setting that is wrong in the other two stores?

  • Frank Groeneveld
    Frank Groeneveld about 13 years
    What do you mean? Isn't the website running as apache as well? So apache should have write permissions in the directory? (it does have those permissions)
  • Barbagallo
    Barbagallo about 13 years
    For some odd reason, how mediatemple has our dedicated virtual machine, the only user that can write files in my httpdocs folder is the ftp user. Strange, I know, and I know how to fix it -- but the fix may break our main application and I don't want to risk it. Not sure if this is in fact the same issue you had, just suggesting to try that out and see if it works.
  • Fraz0r
    Fraz0r over 11 years
    Why was this down-voted? He is correct. If the memory_limit is too low, Magento will not generate thumbnails. And depending on your hosting environment, it is likely that no error will be printed.
  • Fraz0r
    Fraz0r over 11 years
    777 should never be set on a production web directory. Period. You are setting yourself up for a lot more trouble than missing thumbnails.
  • ahgood
    ahgood about 11 years
    Excellent! After tried many many solutions, I found this solution is final correct answer. I'm running Magento (Nginx+PHP-FPM) on a Raspberry Pi. No more broken image now. Thanks.