Magento – 500 Internal Server Error on PHP Image Load

http-error-500magento-1media

This problem happened all of a sudden after Magento was working for 2 years.

When I load a page, a thumb.php GET request is made to load 6-7 images. Now most of them are loaded fine with a 200 response from thumb.php, but there is always 1 image that doesn't load right away and seems to be giving 500 internal server error. If I refresh the page it will load all the images without problem. It's very weird since some of the pages are loading all the images right away without any problem. Any suggestions?

enter image description here

Best Answer

You need to reset the permissions on your media folder and files.

run this from your Magento installation folder

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

If this fixes the problem you should then review the permissions of your Magento installation according to best practice. Further info here What permissions should I give /var and /media?

Also enabling error reporting within php will give you further information to the exact nature of the error instead of the unfriendly 500 Internal Server Error.

Related Topic