Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento 1.9.2.3, after uploading images from backend, permission is set to 640 instead 644

After doing a fresh install of magento 1.9.2.3 I realized that there is a problem when I upload images from the backend. the files get the permission 640 instead 644. How can I adjust this so that when magento uploads an image to the server, it gets 644 ?

At the moment I have to use SSH or acp to manually set the permissions right.

thanks allot!

like image 420
Skypiboy Avatar asked Jan 26 '16 21:01

Skypiboy


2 Answers

Upgrade to Magento 1.9.2.4 which addresses the issues caused by patch SUPEE-7405, or Magento 1.9.2.3. If for some reason you can't upgrade then you should install SUPEE-7405 v 1.1 which will rectify the permissions issue. This patch in Magento's own words restores less restrictive file permissions (0666 for files and 0777 for directories) which will enable you to view images etc as normal.

like image 78
Devtype Avatar answered Nov 26 '22 09:11

Devtype


Open up the following file:

lib/Varien/File/Uploader.php

Look for this line:

chmod($destinationFile, 0640);

Replace it with this line:

chmod($destinationFile, 0644);

Look for this line:

chmod($destinationFile, 0750);

Replace it with this line:

chmod($destinationFile, 0755);
like image 29
Salvio Pepe Avatar answered Nov 26 '22 10:11

Salvio Pepe