Zend Cache APC错误将元数据保存到metadataCache失败

时间:2013-05-11 00:41:50

标签: php zend-framework caching apc

我似乎一直试图让APC从CLI使用Zend Cache。

我知道安装了APC(可以在infophp()中看到它;

我可以转储代码并看到APC值是从配置文件中提取的。

但是当我在命令行上运行命令时: / usr / bin / php -c /var/www/html/php.ini /var/www/html/public/index.php cronhalfhourly

我收到错误: PHP注意:在839行的/ebs1/www/html/library/Zend/Db/Table/Abstract.php中将元数据保存到metadataCache失败

当我使用“File”而不是APC时,它工作正常,fiels被写入缓存目录。当它是APC时,没有文件被写入缓存目录,正如人们所期望的那样。

这是我的代码:

protected function _initCache() {

    $strings_config = Zend_Registry::get('strings_config');

    $frontendOptions = array(
            'lifetime' => 7200,
            'automatic_serialization' => true
            );

    $backendOptions  = array(
            'cache_dir'=> $strings_config->tablemetadatacachepath
            );



    $cache = Zend_Cache::factory('Core',
                                                             $strings_config->backendcache,
                                                             $frontendOptions,
                                                             $backendOptions);

    // Next, set the cache to be used with all table objects        
    Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
Zend_Registry::set('cache',$cache);

}

我被困,有什么想法吗?

0 个答案:

没有答案