Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Caching mixups with multiple SS installations


Go to End


2 Posts   970 Views

Avatar
svandragt

Community Member, 44 Posts

13 June 2013 at 12:11am

Edited: 13/06/2013 3:05am

On my production webserver containing multiple silverstripe installations, after adding and picking a cache backend, I get php errors where extensions from one site are used on another, causing errors because the extensions aren't found. clearly the caches are getting mixed up.

I'm using the following code in /mysite/config.php:

if (Director::isDev()) {
	SS_Cache::set_cache_lifetime('any', -1, 100);
} else {
	SS_Cache::add_backend('two-level', 'Two-Levels', array(
	 	'slow_backend' => 'File',
	 	'fast_backend' => 'Apc',
	 	'slow_backend_options' => array('cache_dir' => TEMP_FOLDER . DIRECTORY_SEPARATOR . 'cache')
	 ));
	 SS_Cache::pick_backend('two-level', 'any', 10);
}

The errors are something like:

[Wed Jun 12 12:25:23 2013] [error] [client ip] PHP Fatal error:  Object::add_extension() - Can't find extension class for "DescriptionDataExtension" in /path/to/phosphorus.angus.ac.uk/public_html/framework/core/Object.php on line 460

Where DescriptionDataExtension is an extension from one of the other sites. Anyone have tips? When I remove the code above (and before I added the code in) the site works fine. SS 3.0.5



Notice: Constant CMS_DIR already defined in /home/administrator/projects/phosphorus.dev/public_html/cms/_config.php on line 7

Call Stack:
    0.0063     687688   1. {main}() /home/administrator/projects/beryllium.dev/public/framework/main.php:0
    0.0105     891072   2. require_once('/home/administrator/projects/beryllium.dev/public/framework/core/Core.php') /home/administrator/projects/beryllium.dev/public/framework/main.php:62
   17.6268   19496504   3. Config->pushConfigManifest() /home/administrator/projects/beryllium.dev/public/framework/core/Core.php:290
   17.6268   19497376   4. SS_ConfigManifest->activateConfig() /home/administrator/projects/beryllium.dev/public/framework/core/Config.php:197
   17.6822   19510552   5. require_once('/home/administrator/projects/phosphorus.dev/public_html/cms/_config.php') /home/administrator/projects/beryllium.dev/public/framework/core/manifest/ConfigManifest.php:103
   17.6822   19510904   6. define() /home/administrator/projects/phosphorus.dev/public_html/cms/_config.php:7

So when I enable caching on my SS sites, the ConfigManifest is pushing manifests from other sites into the current one?

Avatar
svandragt

Community Member, 44 Posts

13 June 2013 at 3:24am

The correct syntax is:

SS_Cache::pick_backend('two-level', 'Two-Levels', 10);