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).

6
  • hi, you should try asking this @ civicrm.stackexchange.com Commented Nov 22, 2016 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
    Commented Nov 22, 2016 at 14:47
  • You're in the right place! Welcome to civicrm.stackexchange.com :D Commented Nov 23, 2016 at 6:04
  • erm, sorry about that!! yes, you are in the right place :) Commented Nov 23, 2016 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
    Commented Dec 2, 2016 at 16:13

2 Answers 2

1

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.

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.

1
  • 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. Commented May 10, 2019 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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