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

Recent comments

Blog comments powered by Disqus
← Previous • Next →

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