Posted on: 02/13/05 09:21am
By: rjrufo
I was trying to do a search on this site for something I read a while ago, but I keep getting this error:
Fatal error: Maximum execution time of 30 seconds exceeded in /path/to/geeklog/system/classes/template.class.php on line 499
(edited file path)
Just thought I'd let someone know.
Geeklog.net having problems?
Posted on: 02/13/05 11:05am
By: sammykrupa
Not having problems doing searches here.
Geeklog.net having problems?
Posted on: 02/13/05 12:50pm
By: ByteEnable
[QUOTE BY= rjrufo]
Fatal error: Maximum execution time of 30 seconds exceeded in /path/to/geeklog/system/classes/template.class.php on line 499
[/QUOTE]
Its a geeklog design error. Whats happening is that your search term has returned lots of results, and its taking the php script longer than 30 seconds to process all the results.
Geeklog.net having problems?
Posted on: 02/13/05 02:06pm
By: ScurvyDawg
Try refining your searcg parameters down to something less general.
Geeklog.net having problems?
Posted on: 02/13/05 02:31pm
By: beewee
I've seen the problem before. It looks a bit silly that such a great system like Geeklog gives such an answer when the search result is too large...
Geeklog.net having problems?
Posted on: 02/13/05 03:20pm
By: rjrufo
I eventually found what I was looking for, but I tried several variations of my search before it stopped having that error. It may be a good idea to increase the timeout to 60 seconds.
Geeklog.net having problems?
Posted on: 02/13/05 03:37pm
By: Dirk
Yes, it's embarrassing, and no, we can't increase the timeout here on the server.
I've spent some time with the search code over Christmas and came up with a few ideas on how to make the search use pagination without breaking the search in plugins at the same time. If I can find the code again (it must be on my iBook somewhere ...) and - more importantly - find the time to put it into CVS, it may eventually make it into a Geeklog release some day ...
I've been wanting to fix this for soooo long ...
bye, Dirk
Geeklog.net having problems?
Posted on: 02/13/05 03:54pm
By: beewee
Or we should forget the standard search box and only use the advanced search function (or an intermediate search box: select where to search: in articles/forum/files/links). This way people find what they need without searching the complete database. The chances of getting these embarassing timeouts could be reduced by about 95% I guess. Also better for the server load.
Geeklog.net having problems?
Posted on: 02/14/05 04:12pm
By: ByteEnable
If you are php inclined, here is a workaround. This limits story search results to 400. Now, if you have lots of comments, it will break again.
In file:
system/classes/search.class.php
// NOTE if any of your data items need to be links then add them
// here! Make sure data elements are in an array and in the same
// order as your headings above!
while ( ($A = DB_fetchArray($result_stories)) && ($story_results->num_searchresults < 400) ) {
// while ($A = DB_fetchArray($result_stories)) {
if (SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['pe
rm_anon']) > 0) {
// get rows
$A['title'] = str_replace('$','$',$A['title']);
$thetime = COM_getUserDateTimeFormat($A['day']);
$articleUrl = '/article.php?story=' . $A['sid'];
if (empty ($urlQuery)) {
$articleUrl = $_CONF['site_url'] . '/article.php?story='
. $A['sid'] . '&query=' . urlencode ($urlQuery);
}
$row = array('<img width="8" height="8" src="/images/fpbullet.png" alt=">"> <a href="' .$_CONF['si
te_url'] . $articleUrl . '">' . stripslashes($A['title']), $thetime[0], DB_getItem($_TABLES['users'],'username',"uid = '{$A
['uid']}'"));
$story_results->addSearchResult($row);
$story_results->num_searchresults++;
} else {
// user is not allowed to see this item so don't count it either
$story_results->num_itemssearched--;
}
}