gpt4 book ai didi

php - 在 Zend Framework 1.10 中加载 "custom resources"

转载 作者:可可西里 更新时间:2023-11-01 00:01:37 25 4
gpt4 key购买 nike

在 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"**

在 library/App/Application/Resource/Cache 我有一个缓存类“App_Application_Resource_Cache extends 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

以防万一有人需要它,在 Bootstrap 中这是 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;
}

最佳答案

@佩卡

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

通过注释掉 get_include/path()(在 index.php 中),我省略了/usr/share/php/中的包含。警告消失了。

感谢您的(极好的)帮助!

显然 PLESK 和 CentOS 存在问题,无法从虚拟主机访问 PHP 的包含路径!

关于php - 在 Zend Framework 1.10 中加载 "custom resources",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2304022/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com