【问题标题】:php fatal error, require oncephp致命错误,需要一次
【发布时间】:2014-03-25 13:17:38
【问题描述】:

大家好,正在使用 Zend search 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/');

谁能给我一些关于发生了什么的建议?谢谢。

【问题讨论】:

    标签: php html zend-framework lucene zend-search-lucene


    【解决方案1】:

    您必须添加 Zend 库以包含路径。

    如果您的 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/ 应该存在并且是可写的。

    【讨论】:

    • 感谢您花时间回答,我将如何包含 zend 库?我搜索过,但我遇到了很多不同的答案
    猜你喜欢
    • 2015-03-28
    • 1970-01-01
    • 1970-01-01
    • 2013-07-23
    • 1970-01-01
    • 2014-05-09
    • 2014-04-27
    • 1970-01-01
    相关资源
    最近更新 更多