簡體   English   中英

在Zend Framework 1.10中加載“自定義資源”

[英]Loading “custom resources” in Zend Framework 1.10

一切都在1.9.6正常工作。 我改為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我有一個類“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

萬一有人需要它,在引導程序中這是Autoload-er

<?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;
    }

@Pekka

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

通過注釋掉get_include/path() (在index.php中),我已經從/ usr / share / php /中省略了include。 警告消失了。

感謝您的(精湛)幫助!

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

好吧,這個問題已在評論中排序:)將此問題作為答案,您可以接受以結束問題。

您不能從PHP腳本訪問該路徑,請查看錯誤消息(/ usr / share不在允許的目錄列表中)。 將包含路徑更改為(我猜)/ var/home/library/Zend/應該解決它。

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

我認為這open_basedir設置,該設置禁止虛擬主機訪問它們之外的任何內容,它不是特定於操作系統的。 無論如何,很高興它排序了!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM