在本地主机上工作,但服务器返回“无法打开流:没有这样的文件或目录”

发布于 2024-09-16 06:30:19 字数 1077 浏览 2 评论 0原文

在我的本地计算机上,脚本运行良好,但是当我将其放在服务器上时,我得到:

应用程序/hooks/zend.php

[9]: require_once(Loader/Autoloader.php) [function.require-once]:未能 打开流:没有这样的文件或目录

堆栈跟踪

application/hooks/zend.php [9]: require_once()

system/core/Kohana.php [199]: 包括( application/hooks/zend.php )

system/core/Bootstrap.php [37]: Kohana::setup()

index.php [106]: 需要(系统/核心/Bootstrap.php)

我正在尝试将 zend 加载到 Kohana 2.3 中。这是 zend.php

<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* zend.php
*/
ini_set('include_path', ini_get('include_path').
PATH_SEPARATOR.SYSPATH.'vendor/');
ini_set('include_path', ini_get('include_path').
PATH_SEPARATOR.SYSPATH.'vendor/Zend/');
require_once 'Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
?>

我已经被这个问题困扰了大约 2 天,并且我遵循了许多不同的教程和不同的路线。所以任何方向都会很棒。目前我的文件结构和设置 与此匹配

On my local machine the script works fine, but when I put it on the server I get:

application/hooks/zend.php

[9]: require_once(Loader/Autoloader.php)
[function.require-once]: failed to
open stream: No such file or directory

Stack Trace

application/hooks/zend.php [9]:
require_once( )

system/core/Kohana.php [199]:
include(
application/hooks/zend.php )

system/core/Bootstrap.php [37]:
Kohana::setup( )

index.php [106]:
require( system/core/Bootstrap.php )

I'm trying to load zend into Kohana 2.3. Here's zend.php

<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* zend.php
*/
ini_set('include_path', ini_get('include_path').
PATH_SEPARATOR.SYSPATH.'vendor/');
ini_set('include_path', ini_get('include_path').
PATH_SEPARATOR.SYSPATH.'vendor/Zend/');
require_once 'Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
?>

I've been stumped on this for about 2 days and I've followed many many different tutorials and different routes of doing it. So any direction would be great. Currently my file structure and set up matches this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月下客 2024-09-23 06:30:19

这每次对我都有效:

<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/Loader/Autoloader.php'); ?>

this works every time for me:

<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/Loader/Autoloader.php'); ?>
我们的影子 2024-09-23 06:30:19

这个怎么样?

if ($path = Kohana::find_file('vendors', 'Zend/library/Zend/Loader'))
{
    ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.dirname(dirname($path)));
    require_once 'Zend/Loader/Autoloader.php';
    Zend_Loader_Autoloader::getInstance();
}

来源: kohana-zend (kolanos)

How about this?

if ($path = Kohana::find_file('vendors', 'Zend/library/Zend/Loader'))
{
    ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.dirname(dirname($path)));
    require_once 'Zend/Loader/Autoloader.php';
    Zend_Loader_Autoloader::getInstance();
}

Source: kohana-zend (kolanos)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文