'Circular resource dependency error in Zend framework 1.12.11
I have running a Zend1 Application on AWS servers. It is zend 1.12.11 and php 5.6 on AWS, I want to set it up on my local machine, On localhost I have php 7.3. I want to setup on my localhost I am getting this error message. Can anybody please let me know either it is due to php version difference or how can I fix this/ Thanks in advance.
PHP Fatal error: Uncaught Zend_Application_Bootstrap_Exception: Circular resource dependency detected in /home/stage2_bigwords_com/library/Zend/Application/Bootstrap/BootstrapAbstract.php:674 Stack trace: #0 /home/stage2_bigwords_com/library/Zend/Application/Bootstrap/BootstrapAbstract.php(641): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource() #1 /home/stage2_bigwords_com/library/Zend/Application/Bootstrap/BootstrapAbstract.php(598): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap() #2 /home/stage2_bigwords_com/application/Bootstrap.php(43): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap() #3 /home/stage2_bigwords_com/application/Bootstrap.php(52): Bootstrap::fetchResource() #4 /home/stage2_bigwords_com/library/Bigwords/BaseController.php(82): Bootstrap::fetchClientvars() #5 /home/stage2_bigwords_com/library/Zend/Controller/Action.php(133): Bigwords_BaseController->init() #6 /home/stage2_bigwords_com/library/Zend/Controller/Dispatcher/Standard.php(281): Zend_Controller_Action->__construct()
in /home/stage2_bigwords_com/library/Zend/Controller/Plugin/Broker.php on line 336
Solution 1:[1]
What happened there is that in your bootstrap you have something like the following code:
class Bootstrap {
public function _initDb() {
$session = $this->bootstrap('session');
}
public function _initSession() {
$db = $this->bootstrap('db');
}
}
As you can see to get DB initialized, you need session initialized. But to init session, you need DB. That is a circular dependency. You need to work around it somehow.
Obviously in your code it does not have to be session and db, but any resource that is initialized in bootstrap.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tomáš Fejfar |
