3

I haven't tried asking on stackexchange before (only the old forums), so please excuse me if I do it in the wrong fashion... I did google this, but couldn't find anything that helped me remove these. I may of course have done something stupid again..

I have some cron-triggered notification messages that keeps appearing on every cron run. They are:

Notice: Constant CIVICRM_USE_MEMCACHE already defined in include_once() (line 314 of /wwwroot/sites/example.org/civicrm.settings.php).

Notice: Constant CIVICRM_MEMCACHE_HOST already defined in include_once() (line 320 of /wwwroot/sites/example.org/civicrm.settings.php).

Notice: Constant CIVICRM_MEMCACHE_PORT already defined in include_once() (line 325 of /wwwroot/sites/example.org/civicrm.settings.php).

Notice: Constant CIVICRM_MEMCACHE_TIMEOUT already defined in include_once() (line 331 of /wwwroot/sites/example.org/civicrm.settings.php).

Notice: Constant CIVICRM_MEMCACHE_PREFIX already defined in include_once() (line 341 of /wwwroot/sites/example.org/civicrm.settings.php).

I'm worried they are more serious than they appear, and they anyway do clog up my log files. What could be the reason for these appearing? I recently did an upgrade to version 4.6.4 (drupal 7.38), but I'm not sure if this was what triggered this.

Appreciate any suggestions!

  • There is a forum thread referring to this error here forum.civicrm.org/index.php?topic=25725.15 in case the circumstances they are facing have any correlation to yours. What version did you upgrade from? Were there any warnings/notices as part of the upgrade that suggested problems had occured? – petednz - fuzion Jul 23 '15 at 0:27
2

Since it's coming from include_once I suspect you have two civicrm.settings.php files.

The correct location is sites/<default or example.org>/civicrm.settings.php

If there's a file in sites/civicrm.settings.php, rename or remove it and see if that ends the errors.

--

EDIT: OK, having reformatted your question I can see the file path isn't actually sites//civicrm.settings.php ... StackExchange was hiding your sites directory because of the angle brackets.

SO - either you have two files (eg sites/default/civicrm.settings.php AND sites/example.org/civicrm.settings.php) OR your site somehow include_once's it after it's already included (?).

Let's use grep to look for files which define that constant:

grep -riE '^define.*CIVICRM_MEMCACHE' /path/to/site/root

If that identifies multiple files with this constant defined, then you probably want to eliminate one of those files. If it only locates a single file, then you may need to dig further to identify why that file is being included twice ... especially when the second time, it's being included using include_once :)

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.