Zend Framework : Could not determine temp directory, please specify a cache_dir manually

后端 未结 8 749
忘了有多久
忘了有多久 2021-01-14 15:44

I am just learning Zend Framework. I created a simple Zend_Form and when I submitted the form I got following error:

An error occurred
Application error
Exce         


        
8条回答
  •  一向
    一向 (楼主)
    2021-01-14 16:19

    Well, it says

    "Please specify a cache_dir manually"
    

    So do that.

    Example from Reference Guide:

    $frontendOptions = array(
       'lifetime' => 7200, // cache lifetime of 2 hours
       'automatic_serialization' => true
    );
    
    $backendOptions = array(
        'cache_dir' => '/path/to/cache' // Directory where to put the cache files
    );
    
    // getting a Zend_Cache_Core object
    $cache = Zend_Cache::factory('Core',
                                 'File',
                                 $frontendOptions,
                                 $backendOptions);
    

    Equivalent when using the Cache Resource Plugin:

    resources.cachemanager.database.frontend.name = Core
    resources.cachemanager.database.frontend.customFrontendNaming = false
    resources.cachemanager.database.frontend.options.lifetime = 7200
    resources.cachemanager.database.frontend.options.automatic_serialization = true
    
    resources.cachemanager.database.backend.name = File
    resources.cachemanager.database.backend.customBackendNaming = false
    resources.cachemanager.database.backend.options.cache_dir = "/path/to/cache"
    resources.cachemanager.database.frontendBackendAutoload = false
    

    Reference:

    • http://framework.zend.com/manual/en/zend.cache.backends.html#zend.cache.backends.file
    • http://framework.zend.com/manual/en/zend.cache.introduction.html
    • http://zendframework.com/manual/en/zend.application.available-resources.html

提交回复
热议问题