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

后端 未结 8 812
忘了有多久
忘了有多久 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条回答
  •  猫巷女王i
    2021-01-14 16:16

    I was using 'memcached' instead of 'File', so my problem was a little bit different. I solved this by using:

            $registry = Zend_Registry::getInstance ();
            $frontendOptions =
            array (
                'lifetime' => APPLICATION_ENV == 'development' ? '10' : '3600', 
                'automatic_serialization' => true
            );
    
    
        $backendOptions = array(
                            'servers' => array( array(
                                'host' => APPLICATION_ENV == 'development' ? '***' : '***', 
                                'port' => '***'
                            ) ),
                            'compression' => true
        );
    
        $cache = Zend_Cache::factory ( 'Core', 'Memcached', $frontendOptions, $backendOptions );
    
    // Below is the fix for the problem! It appears that some validators / translates are caching
    Zend_Locale::setCache($cache);
    Zend_Translate::setCache($cache);
    

提交回复
热议问题