加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 在Zend Framework 1.10中加载“自定义资源”

发布时间:2020-12-13 22:00:20 所属栏目:PHP教程 来源:网络整理
导读:一切都在1.9.6正常工作.我改为1.10,现在基本上每个应用程序资源都有很多警告. 看起来ZF正在我设置的“自定义资源”路径中寻找应用程序资源:pluginpaths.App_Application_Resource =“App / Application / Resource. 有什么方法可以避免这种情况!? (提前感
一切都在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;
    }

解决方法

好吧,这个问题已在评论中排序:)将此问题作为答案,您可以接受以结束问题.

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

Apparently there is a problem with PLESK & CentOS where the include path of PHP is not accessible from the vhosts!

我认为这取决于open_basedir设置,该设置禁止虚拟主机访问它们之外的任何内容,它不是特定于操作系统的.无论如何,很高兴它排序了!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读