views:

97

answers:

3

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

A: 

Try this.

biakaveron
That's one of the things I've tried. Still doesn't solve my ini_get problem. Thanks though.
bradenkeith
What is your local operating system? I mean case sensitive
biakaveron
and whats the problem when you use both Kohana and Zend autoloaders? You have require-once error or something else?
biakaveron
A: 

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)

The Pixel Developer
ini_set is where I was having problems. This is just a different way of writing what I have as my source code. Thanks for the response.
bradenkeith
+2  A: 

this works every time for me:

<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/Loader/Autoloader.php'); ?>
matt ryan
Bam - there it is. It broke it on my local server but I feel like I can patch that. So far this works well... I'll see if there are any side effects.
bradenkeith
if the path is set wrong require_once will through a fatal error. try echoing out the document root on a working page to make sure it's where you think it is. sometimes it's out of place.
matt ryan