In this article you going to see what are the reason behind in Magento 2 images not showing.
If you also having an issue of images not getting display in admin or front-end section then you are at a right place.
But don’t you have to worried regarding this point.
Below are the some reason because of which issue get occur.
We going to check all the point in depth.
Let’s start with main discussion of Magento 2 images not showing.
In first case you going see what are reason because of which image not get display in front-end but display in admin.
First reason, why the image not get display in front-end.
You have mistaken permissions in your /media/ folder
The solution regarding this point is that please check writable permission is given on this folder or not.
Change the permission to 777.
You can do this via using SSH through this command.
Below is the command you have to execute it are as follow.
chmod -R 777 media/
Second reason, Image not display in front-end.
Media folder is owned by one other consumer.
It’s happen when switching of Magento from one server to another.
The best solution is that, ownership of /media/ folder to be change.
By executing below code snippet you can achieve it.
chown -R {username}:{username} media/
Note : Before switching make sure regarding the owner of folder is same as that of web server user.
If not then please contact server guy for their support regarding ownership
Third reason, behind image not display.
PHP memory limit play an important role in case of resize of image in Magento 2.
Due to low memory limit Magento cannot resize their image.
With the help of GD library Magento resize their images.
If the memory limit is not sufficient then Magento will display place holder images.
The solution for this is to increase the PHP memory limit.
To increase the memory limit you can use the .htacess
file.
In .htaccess
file find below given string.
php_value memory_limit 256M
The value should be very least 256M, or higher 512M.
Fourth reason may be the GD library is not Installed or configured.
The solution is to check with the hosting provider as they have installed GD library on server.
With the help of PHP info you can all the details regarding GD library.
Fifth reason is scope of wrong attribute for all images such as small_image, thumbnail, base_image.
Sometimes Magento processes photographs incorrectly, if they’ve scope =
Store View.
Mainly it occur in case of multi-store set up.
The solution is login to admin and go into the following section Magento backend > Catalog > Attributes > Manage attributes
.
Then find image, small_image & thumbnail attributes.
Check properly that attributes have scope =
Global.
Sixth reason is problem with secure mode.
Solution isn’t beneficial to disable secure mode, however if you happen to tried all different options you may attempt to disable secure mode in your server.
Now the second case you going see what are purpose of image not get display in admin.
Mostly it is due to wrong permissions set to uploaded files.
So Open lib/Varien/File/Uploader.php
.
Check the permission is set or not.
Around line 219:
chmod($destinationFile, 0666);
Around line 541:
if (!(@is_dir($destinationFolder) || @mkdir($destinationFolder, 0777, true))) {
One more important point is that, the problem may also be solved by making use of patch SUPEE-7405 v1.1
.
[Solved] Magento 2 Product Image Zoom Not Working
Conclusion
Finally, we done with the point Magento 2 images not showing up in admin or in front-end.
I hope you like this article and if you feel like we missed out on anything, please comment below.