Zend Framework:Multidb 无法初始化
这曾经有效,但经过其他程序员的一些修改后,它就无法工作了。我的 Bootstrap 上有此代码:
protected function _initDatabase ()
{
$resource = $this->getPluginResource('multidb');
$resource->init();
Zend_Registry::set('gtap', $resource->getDb('gtap'));
Zend_Registry::set('phpbb', $resource->getDb('phpbb'));
}
加载后,出现此错误:
致命错误:在非对象上调用成员函数 init() /var/www/gamebowl3/application/Bootstrap.php 第 105 行
我的 php.ini 在 include_path: 上有此条目:
.:/usr/share/php:/etc/apache2/libraries
并且我可以看到 multidb.php 位于:
/etc/apache2/librarties/Zend/Application/Resource
有人能告诉我导致错误的原因吗?谢谢!
This used to work but after some modifications by the other programmers it just fails to work. I have this code on my Bootstrap:
protected function _initDatabase ()
{
$resource = $this->getPluginResource('multidb');
$resource->init();
Zend_Registry::set('gtap', $resource->getDb('gtap'));
Zend_Registry::set('phpbb', $resource->getDb('phpbb'));
}
Upon loading, this error shows up:
Fatal error: Call to a member function init() on a non-object in
/var/www/gamebowl3/application/Bootstrap.php on line 105
My php.ini has this entry on tis include_path:
.:/usr/share/php:/etc/apache2/libraries
and the i can see that multidb.php is located in:
/etc/apache2/librarties/Zend/Application/Resource
Can somebody tell me what causes the error? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚发现问题出在application.ini中。在常用配置集中添加了新引入的设置。如下:
另外,请确保您拥有最新的 Zend Framework Library 并将其添加到 PHP 的包含路径中。那应该可以解决所有问题。
I just found out that the problem is in application.ini. Added a newly-introduced setting to the usual set of configs. Here it is:
Also, make sure you have the latest Zend Framework Library and add it to PHP's include path. That should fix everything up.