4

This is a problem I've had for three or four years, but never solved. I send a monthly mailing to about 50k contacts using CiviMail. Each mailing is scheduled using the standard CiviCRM job scheduling. All works fine except that during the sending, the templates_c/en_GB folder grows to about 30GB or more, and has to be emptied manually (either from the command line or using the the CiviCRM Clean Up Caches page) to stop the server from running out of disk space. The files and directories which are being created under templates_c/en_GB/ all seem to have plausible permissions (read and write for the Apache user, read only for everyone else), so I don't understand why they're not being cleared.

Can anyone suggest anywhere to start looking for a solution? Thanks.

This happens with the following set-up, but I have had the problem for a long time, with all previous versions as well.

CiviCRM 4.7.19
Joomla 3.7.2
php 7.0.19
MySQL 5.6.36

4

Cache files are cleared by a scheduled job, which isn't enabled by default.

  • Go to Administer menu » System Settings » Scheduled Jobs.
  • Find the row labeled Clean-up Temporary Data and Files.
  • On that row, click more menu » Enable.
  • I have this enabled but still have to manually clear the templates_c file almost daily. Not for the reasons stated about but just in general, parts of the CRM or website won't load until I do. Are there any other considerations along with this to add? – Christia Aug 16 '18 at 18:41
  • @christia that sounds like you have a file ownership (and/or permissions) issue. If this is happening almost daily, and I assume you're not logging into the server daily - that suggests that the Unix user running cron isn't the same as the Unix user running your webserver. – Jon G - Megaphone Tech Aug 16 '18 at 19:41
-2

Try changing the templates_c folder permissions to 777 recursively so that every sub directory would have 777 permission also.

  • Setting permissions to 777 is almost never a good idea, and hides the underlying permission issue. Additionally, this does nothing to prevent CiviCRM from creating new template_c files with the default permissions. – Jon G - Megaphone Tech Jan 4 '18 at 19:10

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.