Include_pathdaki Zend_Framework

1 Cevap php
    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';

Düzgün set_include_path ayarı bana yardımcı olun.

1 Cevap

Siz bu gibi satırları kullanıyor:

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

Eğer bu gibi bir include_path olsun ki:

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

O yolun başında . Not - Ben orada olmamalı tahmin ediyorum.

Her yolun başında thoses . kaldırmayı deneyin:

$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".

Yani, bu tür ./var/www gibi bir yol aslında geçerli dizine " içinde olan var dizin içinde olan "the www dizin anlamına gelir.

Ve muhtemelen sunucunun kökünde var dizininde içeride "the www dizin gibi bir şey gerekiyor. "