4

Is it possible in CiviCRM to change extension of cached php files from .php to something else (e.g. .php_ or .txt)? Our host (WPEngine) does not allow guest users to write to php files on production environment.

We run cron by calling the cron URL from another server using curl, but scheduled reminder emails fail because CiviCRM can't write .php files as guest user (more info: Scheduled Reminder Email is Empty).

  • hi, you should try asking this @ civicrm.stackexchange.com – michaelmcandrew Nov 22 '16 at 7:12
  • Hi michaelmcandrew. Is this not civicrm.stackexchange.com?! The URL starts with: http://civicrm.stackexchange.com and the logo says CiviCRM beta. – Soroush Zo Nov 22 '16 at 14:47
  • You're in the right place! Welcome to civicrm.stackexchange.com :D – Chris Burgess Nov 23 '16 at 6:04
  • erm, sorry about that!! yes, you are in the right place :) – michaelmcandrew Nov 23 '16 at 22:01
  • 1
    Thank you Kainuk for looking into this. Fortunately WP Engine fixed the issue yesterday by adding an exception on the firewall for CiviCRM cron URL. – Soroush Zo Dec 2 '16 at 16:13
0

Since CiviCRM is software, yes, in theory it could be changed to work differently. The question is always who is going to do that work?

You could start the ball rolling by identifying where in the code .php files are being generated, and suggest an alternative way of doing it.

  • I just ran into this. The error occurs in symfony/filesystem/Filesystem.php when we rename CachedCiviContainer.[HASH].php[hash] to CachedCiviContainer.[HASH].php. The problem occurs with guest users (as the post indicates) -- as WPEngine doesn't allow guest users to write php files. FWIW -- I tried disabling asset caching, but it stills throws errors. WPEngine is a headache to work with -- but it's very popular. May be worth some investigation to see if we can work around that restriction. – lcdservices May 10 at 21:35
0

I ran into this as well. The issue is caused by the CachedCiviContainer cache -- which will write a .php file.

A workaround for this is to set the following constant in the civicrm.settings.php file:

define('CIVICRM_CONTAINER_CACHE', 'never');

Not ideal, as it disables the container cache altogether. But it avoids these issues.

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.