cancel
Showing results for 
Search instead for 
Did you mean: 

Images do not load due to directory loss or change Magento 2.3

SOLVED

Images do not load due to directory loss or change Magento 2.3

Hi,

 

I think it was after performing the backup (replacing the files), but the cause could be different, on our Magento store the product images stopped loading. They don't load on the frontend, either on the admin backend.

 

We have discovered the reason, Magento renamed a directory of the images, it is a slightly different path. 

 

The old one looks like this one:

<img class="product-image-photo" src="https://websiteaddress/media/catalog/product/cache/f2dfc0e062ef52210b64b7bbcecb985d/a/p/apip9bjxl__20689.1524070911.1280.1280.jpgc-2.jpg" alt="imagetitle">

 

The new path from which Magento tries to load the image is:

<img src="https://websiteaddress/pub/static/frontend/Swissup/argento-stripes/en_GB/Magento_Catalog/images/product/placeholder/image.jpg" alt="Liquid Foundation 30ml" class="fotorama__img" aria-hidden="false">

 

which is the magento image which loads, it happens that if it cannot load the one from the directory with images.

 

We have checked the directory pub media and the images are now under:

"websiteaddress"/pub/media/catalog/product/t/u

the image cache looks like this:

"websiteaddress"/pub/media/catalog/product/cache/image/t/u

 

I think Magento tries to load the previous directory:

"websiteaddress"/pub/media/catalog/product/p/a

 

Why would it change the letters from p/a to t/u ?

and how to fix it?

 

Just want to add that we had try to deploy static content, and the cache (including images cache)

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Images do not load due to directory loss or change Magento 2.3

Win! I found the cause. 

 

So, the directory was missing for most of the images, for some reason, not all moved from the backup files, only a few did. 

Lol. So much time spend to figure this out! 

View solution in original post

3 REPLIES 3

Re: Images do not load due to directory loss or change Magento 2.3

Hi @aga_k,

 

It looks like that your images cache are flushed. 

You need to re-generate the catalog cache. You can generate again using following command. 

Also make sure that your pub/media directory has full write permission.

For Permission:

sudo chmod -R 0777 pub/media

  
To re-generate catalog media cache. 

php bin/magento catalog:images:resize


Flush the cache and try once. 

php bin/magento cache:flush



I hope it will help you!

Re: Images do not load due to directory loss or change Magento 2.3

Hi Vimal, 

 

Thank you for prompt answer, however this will not work as the directory was changed by magento. 

here is message error:

PHP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/intl (/usr/local/lib/php/extensions/no-debug-non-zts-20170718/intl: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20170718/intl.so (/usr/local/lib/php/extensions/no-debug-non-zts-20170718/intl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
File '/home/andrew/public_html/"websitename"/pub/media/catalog/product/a/p/apiornm89__83639.1524749459.1280.1280.jpgc-2.jpg' does not exist.

 

 

Anything more what I could do?

Re: Images do not load due to directory loss or change Magento 2.3

Win! I found the cause. 

 

So, the directory was missing for most of the images, for some reason, not all moved from the backup files, only a few did. 

Lol. So much time spend to figure this out!