Jump to:

23375 Posts in 18175 Topics by 2866 members

General Questions

SilverStripe Forums » General Questions » Caching mixups with multiple SS installations

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

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

Page: 1
Go to End
Author Topic: 322 Views
  • svandragt
    Avatar
    Community Member
    44 Posts

    Caching mixups with multiple SS installations Link to this post

    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?

  • svandragt
    Avatar
    Community Member
    44 Posts

    Re: Caching mixups with multiple SS installations Link to this post

    The correct syntax is:

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

    322 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.