0
我從開發到生產,突然這個錯誤移動網站不斷彈出:試圖讓非對象的財產的Zend引導
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);
所以$的配置似乎是一個無對象,讓我們的var_dump說:
object(Zend_Config_Ini)#43 (11) { ... }
好像一個對象給我,以爲MAYB e配置文件不能被讀取。但我可以打開它,並將其值列入var_dump中。
我的正常網站和這一個唯一的區別;它在一個子域上運行。我找不出與Zend_Config_Ini有什麼關係,尤其是當可以讀取配置文件時。