views:

20

answers:

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

/var/www/vhosts/localhost/httpdocs/public.:./var/www/vhosts/localhost/httpdocs/public/../library:./var/www/vhosts/localhost/httpdocs/public/../model:.


defined('SITE_ROOT') ? null : define('SITE_ROOT',$_SERVER['DOCUMENT_ROOT']);

$includePath[] = '.';
$includePath[] = '.' . SITE_ROOT . '/../library';
$includePath[] = '.' . SITE_ROOT . '/../model';
$includePath[] = get_include_path();
$includePath = implode(PATH_SEPARATOR,$includePath);
set_include_path($includePath);




require_once 'Zend/Loader/Autoloader.php';

Please help me setting properly set_include_path.

+1  A: 

You are using lines such as this :

$includePath[] = '.' . SITE_ROOT . '/../library';

Which get you an include_path such as this :

./var/www/vhosts/localhost/httpdocs/public/../library

Note the . at the beginning of that path -- I'm guessing it shouldn't be there.

Try removing thoses . at the beginning of each path :

$includePath[] = '.';
$includePath[] = SITE_ROOT . '/../library';
$includePath[] = SITE_ROOT . '/../model';
$includePath[] = get_include_path();
$includePath = implode(PATH_SEPARATOR,$includePath);
set_include_path($includePath);


For information : A . in a UNIX path means "current directory" ; and a / at the beginning of a path means "the root of the server".

So, a path such as ./var/www actually means "the www directory that is inside the var directory that is inside the current directory".

And you probably need something like "the www directory that's inside the var directory that's at the root of the server."

Pascal MARTIN
Beck