cancel
Showing results for 
Search instead for 
Did you mean: 

Cached images in Pub folder not displaying

Cached images in Pub folder not displaying

So Magento is creating images in the cache folder. I can see the file and I can download it via FTP. However if I try get to it from a browser it gives a 404 error. The path is definitely correct. Not sure if it htaccess or permissions. Any ideas ?

5 REPLIES 5

Re: Cached images in Pub folder not displaying

You need carefully setup both the web server rewrites and the permissions: http://devdocs.magento.com/guides/v2.0/install-gde/install/file-system-perms.html

Re: Cached images in Pub folder not displaying

For some reason when Magento 2 generates the static files in pub/static it uses the wrong group permissions in my installation.

 

I fixed this by using the bin/magento tool this way:

./bin/magento setup:static-content:deploy

 

Then:

chown -R :<WWWGROUP> pub/static/.

 

Where <WWWGROUP> is the group of your webserver

Re: Cached images in Pub folder not displaying

Magento does not use "wrong group permissions". Magento just uses the account you run ./bin/magento setup:static-content:deploy with,

Re: Cached images in Pub folder not displaying

It does Dmitry becaause when they are generated by default/on the fly they also get generated by a different group then the webserver.

 

I'm am testing Magento 2 in a Plesk 12.5 environment right now and the webserver is in group "psaserv". The main directory and all the files are owned by group "psaserv". However with a fresh Magento installation files in pub/static/ will get created under group "psacln". Probably because my webserver is in both groups and by default Magento happens to choose the wrong one.

 

Also it doesnt use the account you run ./bin/magento setup:static-content:deploy with. Since I ran it with my root account it should be in the "root" group which clearly isn't the case since it uses the "psacln" group

Re: Cached images in Pub folder not displaying

Is there a fix to this issue yet? Can't upload products if the images will not load.