Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

config_cache_enabled Errors

Using Zend Framework 2.1

When I set 'config_cache_enabled' => true inside of my application.config.php

It's returning the following error:

Warning: var_export does not handle circular references in /usr/local/apache/vhosts/otwebsoft_admin/vendor/Zend/ModuleManager/Listener/AbstractListener.php on line 67

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

Fatal error: Call to undefined method Zend\Cache\Storage\Adapter\Apc::__set_state() in /usr/local/apache/vhosts/otwebsoft_admin/data/cache/module-config-cache.otwebsoft.php on line 181

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.

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

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.

Any ideas?

like image 594
Diemuzi Avatar asked Feb 06 '26 02:02

Diemuzi


1 Answers

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
like image 53
Diemuzi Avatar answered Feb 09 '26 02:02

Diemuzi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!