Zend framework 尝试获取非对象Zend引导的属性
我正在将一个站点从开发转移到生产,突然出现了这样一个错误:Zend framework 尝试获取非对象Zend引导的属性,zend-framework,Zend Framework,我正在将一个站点从开发转移到生产,突然出现了这样一个错误: Notice: Trying to get property of non-object in /var/www/vhosts/xxxx/httpdocs/application/Bootstrap.php on line 16 Notice: Trying to get property of non-object in /var/www/vhosts/xxxx/httpdocs/application/Bootstrap.php o
Notice: Trying to get property of non-object in /var/www/vhosts/xxxx/httpdocs/application/Bootstrap.php on line 16
Notice: Trying to get property of non-object in /var/www/vhosts/xxxx/httpdocs/application/Bootstrap.php on line 17
Notice: Trying to get property of non-object in /var/www/vhosts/xxxx/httpdocs/application/Bootstrap.php on line 18
此时的代码写:
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$config = Zend_Registry::get('config');
$param = array( "template_dir" => $config->smarty->template_dir,
"compile_dir" => $config->smarty->compile_dir,
"config_dir" => $config->smarty->config_dir,
"cache_dir" => $config->smarty->cache_dir
);
$view = new Zend_View_Smarty(null, $param);
因此$config似乎是一个非对象,让var_转储它:
object(Zend_Config_Ini)#43 (11) { ... }
对我来说似乎是个对象,我想可能配置文件无法读取。但是我可以fopen,fread它,值列在var_转储中
我的正常站点和这个站点之间的唯一区别;它在子域上运行。我不知道这与Zend_Config_Ini有什么关系,尤其是当可以读取配置文件时。再过一段时间……我发现Ini文件中的一行没有正确地用引号括起来:
site.basedir = "/
应该是:
site.basedir = "/"
那些星期一的早晨:-)