2013-06-18 57 views
0

我有一個Zend Framework應用程序,可以在我的本地OS X機器上正常工作。 Zend文件夾也包含在我的項目library/中。當我建立了我的代碼我的Linux服務器上,現在我得到這個錯誤:從os x部署到linux服務器後Zend Framework baseURL錯誤

Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' 
with message 'Plugin by name 'BaseURL' was not found in the registry; used paths: 
Zend_View_Helper_: Zend/View/Helper/:/var/www/best_dashboard/application/views/helpers/' 
in /var/www/best_dashboard/library/Zend/Loader/PluginLoader.php:412 Stack trace: #0 
/var/www/best_dashboard/library/Zend/View/Abstract.php(1182): Zend_Loader_PluginLoader- 
>load('BaseURL') #1 /var/www/best_dashboard/library/Zend/View/Abstract.php(618): Zend_View_Abstract->_getPlugin('helper', 'baseURL') #2 
/var/www/best_dashboard/library/Zend/View/Abstract.php(344): Zend_View_Abstract- 
>getHelper('baseURL') #3 [internal function]: Zend_View_Abstract->__call('baseURL', Array) 
#4 /var/www/best_dashboard/application/layouts/scripts/layout.phtml(11): Zend_View- 
>baseURL() #5 /var/www/best_dashboard/library/Zend/View.php(108): 
include('/var/www/best_d...') #6 
/var/www/best_dashboard/library/Zend/View/Abstract.php(888): Zend_View- 
>_run('/var/www/best_d...') #7 /var/www/best_dashboard/library/Zen in 
/var/www/best_dashboard/library/Zend/Controller/Plugin/Broker.php on line 336 

一些我已經看到了這個錯誤的其他人是因爲他們從Windows將Linux和爲的BaseURL的情況下不同的和剎車。我不認爲這是我從OS X到Linux的問題。

是什麼導致了這個錯誤?

UPDATE:

我使用Zend Framework 1.12.3

我使用的是Linux服務器和MAMP本地OS X機器上的Apache。

+0

你如何調用的baseUrl()視圖助手? –

+0

<?php echo $ this-> headLink() - > prependStylesheet($ this-> baseURL()。'/ libs/bootstrap/css/bootstrap.css'); '>' –

回答

2

我想打電話給視圖助手的正確方法是

$this->baseUrl() 

(檢查大小寫,Linux是關於有點挑剔)

+0

我在Linux上進行了更改,現在可以使用。我也在我的OS X機器上改變了它,它仍然在工作。只是混淆了爲什麼baseURL在OS X上工作是不是像Linux一樣挑剔? –

+0

老實說,我不知道OS X.我的Windows環境中有一些類似的問題,有些文件名。由於Windows對文件系統不區分大小寫,包括MyFile.php或myFile.php,但對於Linux,MyFile.php和myFile.php是兩個不同的文件。當你在ZF的視圖中調用一個函數時,它將嘗試包含與函數名稱相同但帶有大寫字母的文件。意思是,當你調用$ this-> baseUrl()時,它會尋找BaseUrl.php,但是當你調用$ this-> baseURL()時,它會尋找BaseURL.php。希望這是明確的;) –

相關問題