2010-02-20 55 views
3

在1.9.6中一切正常。我改爲1.10,現在基本上每個應用程序資源都有很多警告。在Zend Framework中加載「自定義資源」1.10

看起來ZF正在從「pluginpaths.App_Application_Resource =」App/Application/Resource中設置的「自定義資源」路徑中尋找應用程序資源。有沒有什麼辦法可以避免這種情況!你提前爲您的時間)

application.ini: 

resources.locale.default = sq_AL 
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" 
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" 
resources.frontController.throwExceptions = 0 

; VIEW & HTML Markup Options 
resources.view.doctype = "HTML5" 
resources.view.language = "en" 
resources.view.setSeparator=" - " 
resources.view.helperPath.View_Helper = APPLICATION_PATH "/views/helpers" 
resources.view[] = 

; custom resources 
**pluginpaths.App_Application_Resource = "App/Application/Resource"** 

在庫/應用/應用/資源/緩存我有一個類「App_Application_Resource_Cache擴展Zend_Application_Resource_ResourceAbstract」我需要緩存。 的問題是,現在的第一頁上我有很多警告,如:

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php/App/Application/Resource/Locale.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/lib64/php/modules/App/Application/Resource/Locale.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php/App/Application/Resource/Frontcontroller.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/lib64/php/modules/App/Application/Resource/Frontcontroller.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php/App/Application/Resource/Layout.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/lib64/php/modules/App/Application/Resource/Layout.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php/./views/helpers/Doctype.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/lib64/php/modules/./views/helpers/Doctype.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php/./views/helpers/HeadMeta.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/lib64/php/modules/./views/helpers/HeadMeta.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php/./views/helpers/HeadTitle.php) is not within the allowed path(s): (/var/home//httpdocs:/tmp:/var/home/) in /var/home//library/Zend/Loader.php on line 190 

萬一有人需要它,在引導,這是自動加載洱

<?php 

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap 
{ 
protected function _initAutoload() 
    { 
    $autoloader = new Zend_Application_Module_Autoloader(
    array(
      'namespace' => 'App', 
      'basePath' => dirname(__FILE__), 
    ) 
    ); 
    return $autoloader; 
    } 
+0

你在使用什麼來下載和更新ZF,PEAR? – 2010-02-20 22:47:40

+0

你可以添加應用程序實際駐留的目錄嗎? – 2010-02-20 22:49:42

+0

@Pekka,我從framework.zend.com網頁下載了ZF文件。 該目錄結構: | - 應用程序 | | - 配置 | | - 控制器 | | - 佈局 | | - 型號 | ' - views | - cache | - httpdocs * | - library | | - App | | - Zend | ' - ZendX ibrary /應用/ ' - 應用 ' - 資源 存在一些問題,編輯在這裏,我看到的。 Zend框架位於庫/ – 2010-02-20 22:57:46

回答

5

嗯,這個問題得到了分類保存在評論:)製作成一個答案,你可以接受關閉問題這一點。

不允許您從您的PHP腳本訪問路徑,查看錯誤信息(在/ usr /股是不是在允許的目錄列表)。改變包含路徑(我猜)/ var/home/library/Zend/應該解決它。

PLESK顯然存在問題& CentOS中,無法從虛擬主機訪問PHP的包含路徑!

我認爲這是設置爲禁止虛擬主機訪問外部任何內容的設置,這不是操作系統特定的。無論如何,很高興它被分類!

7

@Pekka

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'), 
    //get_include_path(), 
))); 

通過註釋掉get_include/path()(的index.php中)我已經ommitted include/from/usr/share/php /。警告消失了。

感謝您對(卓越)的援助!

PLESK & CentOS顯然存在問題,其中包含PHP的路徑無法從虛擬主機訪問!

+0

是的,我只是經歷了這個非常相同的頭痛,併爲我解決它! – 2012-03-29 09:27:26

+0

是的,這個解決方案適用於我在一個在雲中創建的zend應用程序,其中https://phpfog.com/ – sandino 2012-04-21 02:41:01

相關問題