Logo

Edward Ford

  • Archive
  • RSS
  • Ask me anything

Zend Cache Error – Silverstripe 2.4 admin

After uploading a new site built on Silverstripe 2.4 to my shared host, the following error reared it’s head when trying to access the admin area.

[User Error] Uncaught Zend_Cache_Exception: cache_dir is not writable

After some searching through the Silvstripe forums, I finally ended up at finding a resolved support ticket that showed an easy solution in the mysite/_config.php.

First, check the silverstripe-cache folder exists in your site’s root directory, and ensure it is writable.

Then add the following line anywhere in your _config.php file.

$_SERVER['TMPDIR'] = '/absolute_path_to_your_cache_foler/silverstripe-cache';

Finally revisit your admin with flushed cache (/admin?flush=1)

This fix worked fine for me but I have seen it hasn’t worked for others. A last case solution for those that need a quick fix would be to edit the cache directory in /sapphire/thirdparty/Zend/Cache/Backend/File.php.  Change:

protected $_options = array(
'cache_dir' => 'CHANGE_TO_CACHE_DIR',
'file_locking' => true,
'read_control' => true,
'read_control_type' => 'crc32',
'hashed_directory_level' => 0,
'hashed_directory_umask' => 0700,
'file_name_prefix' => 'zend_cache',
'cache_file_umask' => 0600,
'metadatas_array_max_size' => 100
);

The file is part of the Sapphire core so this solution is not advised as a long term fix, and could quick easily be overwritten in future updates.

    • #Bug Fix
    • #Silverstripe
    • #Zned Cache
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Allowed memory size error in Silverstripe

Silverstripe have made great improvements in the memory consumption in version 2.4 but the admin area can still get the frustrating error message.

Fatal error: Allowed memory size of 268435456 bytes exhausted

There are a few options to fix the issue:

  1. In mysite/_config.php - Add ini_set(“memory_limit”, “64M”)
  2. In .htaccess - Add php_value memory_limit 64M

Personally, I have found the 2nd option to be the best and most reliable throughout the website.

Some shared hosts lock down the options to increase memory limits so some digging around the support docs might be required if the above don’t work.

    • #htaccess
    • #memory limit
    • #silverstripe
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Edward Ford

About

Freelance Digital Marketing Consultant & Web Developer venturing around the world on route to San Francisco.

See my portfolio site

Me, Elsewhere

  • @edward_ford on Twitter
  • My Skype Info
  • Linkedin Profile

Twitter

loading tweets…

Following

I Dig These Posts

See more →
  • Post via aslakhellesoy
    Cucumber 1.0.0

    Cucumber

    I am so thrilled about this I set up a blog!

    Today I released Cucumber 1.0.0 after three years in the making. Here are...

    Post via aslakhellesoy
  • Photo via theartofanimation

    Yun Byoung Chul PENE MENN

    Photo via theartofanimation
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr