开发者

Working on localhost but server returns "Failed to open stream: No such file or directory"

开发者 https://www.devze.com 2023-01-13 13:30 出处:网络
On my local machine the script works fine, but when I put it on the server I get: application/hooks/zend.php

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('inclu开发者_如何学Gode_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


this works every time for me:

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


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号