2012-02-20 126 views
2

我Zend框架和代碼的PHP的使用庫(沒有使用結構Zend的,只使用Zend框架的庫),當我加載的Zend的庫是錯誤:錯誤時Zend框架的加載庫

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Search/Lucene/Storage/File/Filesystem.php' 
(include_path='.;C:\php\pear;C:\wamp\www\Zend') in C:\wamp\www\...\Zend\Search\Lucene\Storage\Directory\Filesystem.php on line 349 

我把Zend公司的圖書館在C:\ WAMP \ WWW \ Zend的 我打電話的Zend庫在這裏代碼PHP:

ini_set("include_path", ini_get("include_path") . ";C:\\wamp\\www\\Zend"); 
require_once 'Zend/Search/Lucene.php'; 

如何加載Zend公司的圖書館在這種情況下?

回答

1

嘗試改變:

ini_set("include_path", ini_get("include_path") . ";C:\\wamp\\www\\Zend"); 

ini_set("include_path", ini_get("include_path") . PATH_SEPARATOR . 'C:\\wamp\\www'); 

由於所有Zend框架文件都包含在Zend目錄領先的文件名(即require_once 'Zend/Search/Lucene.php'; include路徑應該包括所在路徑目錄是Zend,但不應該將Zend文件夾本身添加到include_path


考慮require_once 'Zend/Loader.php';與以下路徑:

C:\\wamp\\www\\Zend;解析爲require_once 'C:\\wamp\\www\\Zend\\Zend\Loader.php';(錯誤)

C:\\wamp\\www,解析爲require_once 'C:\\wamp\\www\\Zend\Loader.php';(正確)