PDA

View Full Version : Search this Thread problem?


drumsy
09-22-2003, 03:01 PM
It seems this just started happening so I don't know where to start, but certain words like new car trigger this error:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 8 bytes) in /usr/local/apache2/htdocs/honda-acura.net/forums/search.php on line 456

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 6 bytes) in /usr/local/apache2/htdocs/honda-acura.net/forums/admin/functions.php on line 2637

Running vB 2.3.2. What to do?

Velocd
09-22-2003, 07:18 PM
That's a weird error. Post what is around line 456 in search.php and 2637 in functions.php.

drumsy
09-23-2003, 06:12 PM
Search.php Lines 445 to 465

Line 456 is:

$goodpostlist .= "$key,";

if ( is_array($notlist) AND $good!=0 ) {
reset($notlist);
while ( list($keyw,$id)=each($notlist) ) {
if ( strlen(strpos($val, ",$id,")) ) {
$good = 0;
break;
}
}
}

if ($good==1) {
$goodpostlist .= "$key,";
}
}

$wheresql = " 1=1 ";

if (!$goodpostlist) {
eval("standarderror(\"".gettemplate("error_searchnoresults")."\");");
}
}


Functions.php Lines 2630 to 2648

Line 2637 is:

$DB_site->query($query);

// ###################### Start doshutdown #######################
$shutdownqueries=array();
function doshutdown() {
global $shutdownqueries,$DB_site;

if (is_array($shutdownqueries)) {
while (list($devnul,$query)=each($shutdownqueries)) {
$DB_site->query($query);
}
}

global $cookietimeout,$bypass,$bbuserinfo,$session;

if ($bypass and $bbuserinfo['userid']) {
// if the user has sent bypass=1 through the url (to prevent updating of last activity/visit time), reset the session
// so the below function doesn't do update their info anyway
$userinfo=$DB_site->query_first("SELECT lastactivity FROM user WHERE userid='$bbuserinfo[userid]'");
$DB_site->query("UPDATE session SET lastactivity='$userinfo[lastactivity]' WHERE sessionhash='".addslashes($session['dbsessionhash'])."'");
}

Erwin
09-24-2003, 04:37 AM
You need to increase the memory allocated in my.cnf from 8 MB to 12 MB or 16 MB. If you are on a shared server get your host to do it for you.

drumsy
09-24-2003, 03:25 PM
I'm on dedicated. This is the what I currently have in /etc/my.cnf that Eva suggested:


[mysqld]
set-variable = max_connections=650
set-variable = key_buffer=32M
set-variable = myisam_sort_buffer_size=64M
set-variable = join_buffer=1M
set-variable = record_buffer=2M
set-variable = sort_buffer=2M
set-variable = table_cache=1024
set-variable = thread_cache_size=64
set-variable = wait_timeout=1800
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10

[safe_mysqld]
open_files_limit=8192

[mysqldump]
quick
set-variable = max_allowed_packet=16M

[myisamchk]
set-variable = key_buffer=64M
set-variable = sort_buffer=64M
set-variable = read_buffer=16M
set-variable = write_buffer=16M


I don't see where to add it? I also see that I have a /root/my.cnf, but what's listed there is different numbers than what I have in /etc/my.cnf. Should I copy /etc/my.cnf over to /root/my.cnf?