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 孟德尔随机化结果不一致
  • ¥20 求用stm32f103c6t6在lcd1206上显示Door is open和password:
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法