Any clues on how to get rid of this PHP error?
[26-Jan-2010 00:53:22] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58
[26-Jan-2010 01:38:37] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58
[26-Jan-2010 04:33:40] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58
[26-Jan-2010 05:33:16] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58
[26-Jan-2010 07:36:43] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58
[26-Jan-2010 10:32:52] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58
Offending code fragment below:
foreach ( $matchWords as $key=>$item ) {
if ( $item == '' || in_array(strtolower($item), $stopWords) || strlen($item) <= 3 ) {
unset($matchWords[$key]); //offending line 58
}
if ( preg_match('/^[ \t]+/',$item) ) {
unset($matchWords[$key]);
}
}
---------- Post updated at 20:41 ---------- Previous update was at 15:26 ----------
I think I fixed this......
The problem seemed to be short queries (one letter, for example) in apropos (all sections) generating too large of search results.
Basically, I have limited the queries, something like this:
if (!preg_match("/^\w[\w\-]+$/",$query) && !preg_match("/^\w\w+\.\w+$/",$query) && !preg_match("/^\w\w+::\w+$/",$query)) {
notfound();
$showresults=0;
}
Surely there is a cleaner, better, nicer way... but I'll leave that for another day