douquan2023 2012-06-01 15:32
浏览 42
已采纳

Zend Lucene:致命错误,最长执行时间

I've written a basic indexing script for my site and it seems to be working...somewhat. It gets through about 3/4 of the pages it needs to index and then give this error:

Fatal error: Maximum execution time of 0 seconds exceeded in /Zend/Search/Lucene/Analysis/Analyzer.php on line 166

It seems to hang up in a different spot each time, too. I ran it a minute later and got this:

Fatal error: Maximum execution time of 0 seconds exceeded in /Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 349

Here's the script:

foreach($all_items as $item) {
    $doc = new Zend_Search_Lucene_Document();

    $doc->addField(Zend_Search_Lucene_Field::Text('title', $item['pagetitle']));

    $doc->addField(Zend_Search_Lucene_Field::Text('url', $item['url']));

    $doc->addField(Zend_Search_Lucene_Field::Text('country', $item['country']));

    // Add document to the index
    $index->addDocument($doc);
}
  • 写回答

1条回答 默认 最新

  • douzhi7451 2012-06-01 15:42
    关注

    Maybe your task is time consuming? Then increase time limit set_time_limit:

     set_time_limit(0); //no time limit
     set_time_limit(500) //500 sec limit
    

    Try increasing max_execution_time

     ini_set('max_execution_time', 5000); 
    

    There is also max_input_time

     ini_set('max_input_time', 5000); 
    

    If it still does not work, you will need to track down parts what is executing forever

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿