Jump to:

4951 Posts in 14058 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Uncaught Zend_Cache_Exception: cache_dir must be a directory

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1 2 3 4 5
Go to End
Author Topic: 22475 Views
  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: Uncaught Zend_Cache_Exception: cache_dir must be a directory Link to this post

    Same thing here, fixed it with the solution from xeraa (thank you!).

    One extra note is that the system I am currently working on is secured with open_basedir, so I can not even make the /tmp dir writable if I wanted to.

  • joshpennington
    Avatar
    Community Member
    4 Posts

    Re: Uncaught Zend_Cache_Exception: cache_dir must be a directory Link to this post

    This solution also worked for me. Thanks xeraa.

  • atticusservices
    Avatar
    Community Member
    10 Posts

    Re: Uncaught Zend_Cache_Exception: cache_dir must be a directory Link to this post

    Same problem. Running 2.4.0 on Snow Leopard w/ MAMP Pro 1.8.4, PHP 5.2.11.

    The problem occurs to be in the function getTmpDir() of:
    /sapphire/thirdparty/Zend/Cache/Backend.php

    The previously mentioned solution ONLY works until reboot.

    TEMPORARY SOLUTION:
    Comment line 166.
    "// if (isset($_ENV['TMPDIR'])) return $_ENV['TMPDIR'];"

  • J2-Paul
    Avatar
    Community Member
    51 Posts

    Re: Uncaught Zend_Cache_Exception: cache_dir must be a directory Link to this post

    I am having the same problem. But none of the suggest fixes seem to be working. The issue could be my enviroment. I am in Windows and think most of the guys are in unix.

    My enviroment: Win2003 server, PHP5.2.12, mysql 5.1 iis6, Helicon 3 rewrite.

    I installed a clean v2.4.0. and get this error on the admin.

    Any help much appreciated.

    Thanks

    [User Error] Uncaught Zend_Cache_Exception: cache_dir must be a directory
    GET /admin/

    Line 208 in E:\websites\_SilverStripe\Reception-Screen.v2.4\sapphire\thirdparty\Zend\Cache.php

    Source

    199 *
    200 * Note : for perf reasons, the "load" of Zend/Cache/Exception is dynamic
    201 * @param string $msg Message for the exception
    202 * @throws Zend_Cache_Exception
    203 */
    204 public static function throwException($msg)
    205 {
    206 // For perfs reasons, we use this dynamic inclusion
    207 require_once 'Zend/Cache/Exception.php';
    208 throw new Zend_Cache_Exception($msg);
    209 }
    210
    211 /**
    212 * Normalize frontend and backend names to allow multiple words TitleCased
    213 *
    214 * @param string $name Name to normalize
    Trace

    Zend_Cache::throwException(cache_dir must be a directory)
    Line 153 of File.php
    Zend_Cache_Backend_File->setCacheDir(/temp/)
    Line 120 of File.php
    Zend_Cache_Backend_File->__construct(Array)
    Line 152 of Cache.php
    Zend_Cache::_makeBackend(File,Array,,)
    Line 93 of Cache.php
    Zend_Cache::factory(Core,File,Array,Array)
    Line 835 of Data.php
    Zend_Locale_Data::getContent(en_US,date)
    Line 962 of Format.php
    Zend_Locale_Format::getDateFormat(en_US)
    Line 81 of DateField.php
    DateField->__construct(SiteTreeFilterDate)
    Line 224 of CMSMain.php
    CMSMain->SiteTreeFilterDateField()
    Line 369 of ViewableData.php
    ViewableData->obj(SiteTreeFilterDateField,,,1)
    Line 445 of ViewableData.php
    ViewableData->XML_val(SiteTreeFilterDateField,,1)
    Line 102 of .cacheE..websites._SilverStripe.Reception-Screen.v2.4.cms.templates.Includes.CMSMain_left.ss
    include(C:\WINDOWS\Temp\silverstripe-cacheE--websites-_SilverStripe-Reception-Screen.v2.4\.cacheE..websites._SilverStripe.Reception-Screen.v2.4.cms.templates.Includes.CMSMain_left.ss)
    Line 392 of SSViewer.php
    SSViewer->process(CMSMain)
    Line 342 of ViewableData.php
    ViewableData->renderWith(Array)
    Line 483 of LeftAndMain.php
    LeftAndMain->Left()
    Line 369 of ViewableData.php
    ViewableData->obj(Left,,,1)
    Line 445 of ViewableData.php
    ViewableData->XML_val(Left,,1)
    Line 59 of .cacheE..websites._SilverStripe.Reception-Screen.v2.4.cms.templates.LeftAndMain.ss
    include(C:\WINDOWS\Temp\silverstripe-cacheE--websites-_SilverStripe-Reception-Screen.v2.4\.cacheE..websites._SilverStripe.Reception-Screen.v2.4.cms.templates.LeftAndMain.ss)
    Line 392 of SSViewer.php
    SSViewer->process(CMSMain)
    Line 202 of Controller.php
    Controller->handleAction(SS_HTTPRequest)
    Line 134 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    Controller->handleRequest(SS_HTTPRequest)
    Line 283 of Director.php
    Director::handleRequest(SS_HTTPRequest,Session)
    Line 127 of Director.php
    Director::direct(admin/)
    Line 127 of main.php

  • atticusservices
    Avatar
    Community Member
    10 Posts

    Re: Uncaught Zend_Cache_Exception: cache_dir must be a directory Link to this post

    J2-Paul,

    This is a temporary fix to at least get you up and running until a better solution is found...

    You should be able to replace the function getTmpDir() in "/sapphire/thirdparty/Zend/Cache/Backend.php" with the following:

    static function getTmpDir()
    {
    return "C:\cache\directory\of\your\choice";
    }

  • J2-Paul
    Avatar
    Community Member
    51 Posts

    Re: Uncaught Zend_Cache_Exception: cache_dir must be a directory Link to this post

    Thanks Atticusservices. However, no dice. This is update I made to "/sapphire/thirdparty/Zend/Cache/Backend.php"

    static function getTmpDir()
    {
    return "C:\temp\cache\ss";
    }

    I event deleted the existing code.

    I get the same error. See trace below.

    Thanks in advance for any help.

    Paul

    ******************

    [User Error] Uncaught Zend_Cache_Exception: cache_dir must be a directory
    GET /admin/

    Line 208 in E:\websites\_SilverStripe\Reception-Screen.v2.4\sapphire\thirdparty\Zend\Cache.php

    Source

    199 *
    200 * Note : for perf reasons, the "load" of Zend/Cache/Exception is dynamic
    201 * @param string $msg Message for the exception
    202 * @throws Zend_Cache_Exception
    203 */
    204 public static function throwException($msg)
    205 {
    206 // For perfs reasons, we use this dynamic inclusion
    207 require_once 'Zend/Cache/Exception.php';
    208 throw new Zend_Cache_Exception($msg);
    209 }
    210
    211 /**
    212 * Normalize frontend and backend names to allow multiple words TitleCased
    213 *
    214 * @param string $name Name to normalize
    Trace

    Zend_Cache::throwException(cache_dir must be a directory)
    Line 153 of File.php
    Zend_Cache_Backend_File->setCacheDir(/temp/)
    Line 120 of File.php
    Zend_Cache_Backend_File->__construct(Array)
    Line 152 of Cache.php
    Zend_Cache::_makeBackend(File,Array,,)
    Line 93 of Cache.php
    Zend_Cache::factory(Core,File,Array,Array)
    Line 835 of Data.php
    Zend_Locale_Data::getContent(en_US,date)
    Line 962 of Format.php
    Zend_Locale_Format::getDateFormat(en_US)
    Line 81 of DateField.php
    DateField->__construct(SiteTreeFilterDate)
    Line 224 of CMSMain.php
    CMSMain->SiteTreeFilterDateField()
    Line 369 of ViewableData.php
    ViewableData->obj(SiteTreeFilterDateField,,,1)
    Line 445 of ViewableData.php
    ViewableData->XML_val(SiteTreeFilterDateField,,1)
    Line 102 of .cacheE..websites._SilverStripe.Reception-Screen.v2.4.cms.templates.Includes.CMSMain_left.ss
    include(C:\WINDOWS\Temp\silverstripe-cacheE--websites-_SilverStripe-Reception-Screen.v2.4\.cacheE..websites._SilverStripe.Reception-Screen.v2.4.cms.templates.Includes.CMSMain_left.ss)
    Line 392 of SSViewer.php
    SSViewer->process(CMSMain)
    Line 342 of ViewableData.php
    ViewableData->renderWith(Array)
    Line 483 of LeftAndMain.php
    LeftAndMain->Left()
    Line 369 of ViewableData.php
    ViewableData->obj(Left,,,1)
    Line 445 of ViewableData.php
    ViewableData->XML_val(Left,,1)
    Line 59 of .cacheE..websites._SilverStripe.Reception-Screen.v2.4.cms.templates.LeftAndMain.ss
    include(C:\WINDOWS\Temp\silverstripe-cacheE--websites-_SilverStripe-Reception-Screen.v2.4\.cacheE..websites._SilverStripe.Reception-Screen.v2.4.cms.templates.LeftAndMain.ss)
    Line 392 of SSViewer.php
    SSViewer->process(CMSMain)
    Line 202 of Controller.php
    Controller->handleAction(SS_HTTPRequest)
    Line 134 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    Controller->handleRequest(SS_HTTPRequest)
    Line 283 of Director.php
    Director::handleRequest(SS_HTTPRequest,Session)
    Line 127 of Director.php
    Director::direct(admin/)
    Line 127 of main.php

  • atticusservices
    Avatar
    Community Member
    10 Posts

    Re: Uncaught Zend_Cache_Exception: cache_dir must be a directory Link to this post

    Not sure why, but it is still trying to write to "/temp/" which doesn't exist. Do you have permissions set for PHP to write to the directory you are setting?

    "Zend_Cache_Backend_File->setCacheDir(/temp/)"

  • yurigoul
    Avatar
    Community Member
    202 Posts
    22475 Views
Page: 1 2 3 4 5
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.