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
you can put in .htaccess
SetEnv TEMP /tmp
I think this solve the problem , it solved it for me
Zend_Date::setOptions(array('cache' => $cache)); // Active aussi pour Zend_Locale
Zend_Translate::setCache($cache);
add it after setting your cache in the bootstrap.php
Turn off/disable cache :) Why do you use it for simple app, when learning? There are more important things to learn ;)
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);
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:
Something like this should be helpful:
$_SERVER['TEMP'] = realpath(dirname(__FILE__) . '/tmp');