Search code examples
phpkohanalocalhostzend-autoloader

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


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


Solution

  • this works every time for me:

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