簡體   English   中英

Include_Path Zend_Framework

[英]Include_Path Zend_Framework

    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';

請幫助我正確設置set_include_path。

您正在使用這樣的行:

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

這將為您提供諸如此類的include_path:

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

注意. 在那條道路的開始-我猜它不應該在那里。

嘗試刪除那些. 在每個路徑的開頭:

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


參考信息: . 在UNIX路徑中表示“ 當前目錄 ”; 路徑開頭的/表示“ 服務器的根 ”。

因此,諸如./var/www的路徑實際上意味着“位於當前目錄內的var目錄內的www目錄”

您可能需要類似“位於服務器根目錄的var目錄中的www目錄”之東西

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM