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

StackOverflow https://stackoverflow.com/questions/3602656

문제

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

도움이 되었습니까?

해결책

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)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top