Images in /media/catalog/product/cache are created as root:root.

These images give 403 errors.

What file creates these cache files, is it Mage.php?

I have checked the root directory and all the files are root:root except /media.

I am hosting with apache


Assuming your apache isn't running as root (I'm assuming when you refer to a 403 you mean apache can't serve it), it's likely one of:

  1. You have the cron running as root and one of the crons performs an action that causes image cache to get generated.
  2. You ran a shell script from the CLI that performs an action that causes image cache to get generated.
  • Yes, apache is running as www-data – stephen Jan 8 '15 at 12:36
  • There are no cronjobs though... – stephen Jan 8 '15 at 12:42
  • If you delete the contents of /media/catalog/product/cache and make a request to the website, presumably the generated files will be owned by www-data, since apache shouldn't be able to chown them to root. Therefore the root ownership must be done outside of apache. – Peter O'Callaghan Jan 8 '15 at 12:45
  • Oh there are magento cronjobs – stephen Jan 8 '15 at 12:50
  • The solution was to make sure magento is owned by www-data – stephen Jan 23 '15 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.