config_cache_enabled 错误 [英] config_cache_enabled Errors

查看:26
本文介绍了config_cache_enabled 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Zend 框架 2.1

Using Zend Framework 2.1

当我设置 'config_cache_enabled' =>true 在我的 application.config.php

它返回以下错误:

警告:var_export 不处理第 67 行/usr/local/apache/vhosts/otwebsoft_admin/vendor/Zend/ModuleManager/Listener/AbstractListener.php 中的循环引用

刷新几次页面后,我得到了这个:

After a few refreshes of the page then I get this:

致命错误:调用/usr/local/apache/vhosts/otwebsoft_admin/data/cache/module-config-cache.otwebsoft 中未定义的方法 Zend\Cache\Storage\Adapter\Apc::__set_state()第 181 行的 .php

我现在可以看到该文件已在服务器上创建.当然,在配置中将值设置回 false 会消除所有错误.但是现在我们失去了缓存功能.

I can see now that file is created on the server. Of course setting the value back to false in the config removes all the errors. But now we have loss of cacheing functionality.

是的,我将 APC 适配器用于我的缓存.

Yes, I am using the APC Adapter for my cache.

阅读它推荐使用序列化的 PHP 文档.因此,我查看了源代码并将 var_export 更改为序列化并消除了该错误,但它又带回了此处列出的第二个错误.

Reading the PHP documentation it recommends to use serialize. So I looked at the source code and changed the var_export to serialize and that removes that error, but it brings back the 2nd error listed here.

有什么想法吗?

推荐答案

我终于想通了.我不知道为什么我花了这么长时间,但现在一切都有意义了.

I've finally figured this out. I don't know why it took me so long but everything makes sense now.

所以闭包应该是这样的:

So a closure would be something like:

'example' => factory()
{
    return new Example();
}

我应该使用的地方(例如):

Where-as I should be using (for example):

'example' => 'Module/Service/Example'

删除所有闭包后,我现在可以使用

After I removed all the closures I'm now able to use

'config_cache_enabled' => true

这篇关于config_cache_enabled 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆