首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Zend Framework1.10中加载“自定义资源”

问在Zend Framework1.10中加载“自定义资源”
EN

Stack Overflow用户
提问于 2010-02-21 06:39:20
回答 2查看 6.1K关注 0票数 3

在1.9.6中,一切都运行良好。我更改到了1.10,现在我对基本上每个应用程序资源都有很多警告。

看起来ZF正在我设置的“自定义资源”路径中寻找应用程序资源: pluginpaths.App_Application_Resource =“应用程序/应用程序/资源。有什么方法可以避免这种情况吗!?(提前感谢您的宝贵时间)

代码语言:javascript
复制
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 extends Zend_Application_Resource_ResourceAbstract“类,它是缓存所需的。问题是,现在在第一个页面上,我有很多警告,比如:

代码语言:javascript
复制
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

以防有人需要它,在引导程序中,这是自动加载器

代码语言:javascript
复制
<?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;
    }
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-02-21 07:21:06

好了,这个问题在评论中进行了排序:)将这个问题变成一个你可以接受的答案来结束这个问题。

不允许从PHP脚本访问该路径,请查看错误消息(/usr/share不在允许的目录列表中)。将包含路径更改为(我猜) /var/home/library/Zend/应该可以解决这个问题。

PLESK & CentOS显然有一个问题,无法从虚拟主机访问

的包含路径!

我认为这是由于open_basedir设置禁止虚拟主机访问它们之外的任何东西,而不是特定于操作系统。不管怎样,很高兴它被整理好了!

票数 5
EN

Stack Overflow用户

发布于 2010-02-21 07:12:40

@Pekka

代码语言:javascript
复制
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的包含路径!

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2304022

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档