Zend Lucene: fatal error, maximum execution time
I wrote a basic indexing script for my site and it seems to work ... somewhat. It crawls about 3/4 of the pages that it needs to index and then throw this error:
Fatal error: Maximum execution time exceeded 0 seconds /Zend/Search/Lucene/Analysis/Analyzer.php on line 166
It seems that each time he hanged himself in a different place. I ran it a minute later and got this:
Fatal error: Maximum execution time exceeded 0 seconds /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);
}
0
source to share
1 answer
Perhaps your task is taking a long time? Then increase the 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 doesn't work, you will need to track down the parts that run forever
+5
source to share