PHP致命错误,要求一次


php fatal error, require once

大家好,我正在使用Zend搜索lucene,我得到以下警告和错误:

   Warning: require_once(Zend/Search/Lucene/Storage/File/Filesystem.php): failed to open stream: No such file or directory in G:'xampp'htdocs'Zend'Search'Lucene'Storage'Directory'Filesystem.php on line 349
Fatal error: require_once(): Failed opening required 'Zend/Search/Lucene/Storage/File/Filesystem.php' (include_path='.;'xampp'php'PEAR') in G:'xampp'htdocs'Zend'Search'Lucene'Storage'Directory'Filesystem.php on line 349

我想是这一行让它发生了:

$index = Zend_Search_Lucene::create('LuceneData/');
谁能给我一些建议,到底是怎么回事?谢谢。

您必须添加Zend Library以包含path。

如果你的Zend框架是在G:'xampp'htdocs'includes'Zend,那么你必须包含它:

<?php
$path = 'G:'xampp'htdocs'includes'Zend';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

你也应该给出Lucene数据的绝对路径。例如:

$index = Zend_Search_Lucene::create('/var/searchindex/LuceneData/');

文件夹/var/searchindex/LuceneData/应该存在并且是可写的