Permission problems in the magento directory. How to reset permissions?

0

I have a problem with the /media/tmp/ and /media/catalog/product/ folder of the magento. When attempting to upload product images into product creation, the image is sent to the site but does not appear in the product image listing as shown in the image below.

  

I know why this happens but I do not know how to solve it.

In both the temporary directory and the definitive directory, the image is 640 when it is pushed into the folder and should be given the 644 permission. When I use magento-cleanup.php , everything returns to normal because the script simply resets all existing folder and file permissions.

    
asked by anonymous 16.04.2016 / 17:20

1 answer

1

Open the following file: lib/Varien/File/Uploader.php Find this line:

    chmod($destinationFile, 0640);

Replace 640 with 644, thus:

    chmod($destinationFile, 0644);

Find this other line:

 if (!(@is_dir($destinationFolder) || @mkdir($destinationFolder, 0750, true))) {

Replace 750 with 755, thus:

 if (!(@is_dir($destinationFolder) || @mkdir($destinationFolder, 0755, true))) {

Now just go to your Magento administrative panel and upload a new image to check it out.

  

Previously uploaded images that are not appearing should have   the permissions changed manually.

Source: link

    
29.04.2016 / 17:07