2

After templates_c and en_US files are removed/deleted, Civi will recreate new folders and files. (This is recommended when upgrading Civi). Running as Apache these folders/files are then re-created with Apache as owner and group along with a 751 permission enter image description here

This creates other problems. Drush running as a different user (other than Apache) can be denied access. Changing owners via other commands can cause other failures - as only Apache as owner has write access.

If these permissions were set as 775 (or 771), the problem would not occur. Is there a reason why these are set to 751? Where is this permission defined when new folders and files are created? There are workarounds but but have other consequences that are not desirable. (Other SE postings suggest things like 777 permissions - also not good.)

  • we are using this command to address the problem: setfacl -d -m group:apache:rw- /var/www/html/sites/default/files/civicrm/templates_c – Dave T Apr 7 '18 at 13:33
  • You might have an odd umask set on the apache user account. It sounds like you have shell access so just type umask as the apache user. Normally it's 022. Can also check /etc/bashrc for the global setting. – Demerit Apr 8 '18 at 13:40
2

I always # sudo -u apache drush [command] when running drush anyway. That way if drush creates new files or directories they JustWork(tm) in drupal.

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.