litespeed - database connections errors

#1
Hi ,

few days ago my datacenter support suggested me to use litespeed instead of apache and as we tried i'm happy with it . speed is great and pages loads much faster . but in one of our websites we have database connection errors !

we have few rewrite rules for these websites , first i thought those lines are the reasons and i removed them but still we get errors :

Warning: mysql_query() [function.mysql-query]: Unable to save result set in /home/mechoddl/public_html/admin/user.php on line 18

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/u/public_html/admin/user.php on line 18

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/u/public_html/admin/user.php on line 27
Failed to connect to databases, contact
and here are the lines (18 & 27):
$dls = mysql_fetch_array(mysql_query("SELECT * FROM downloads WHERE reports='0'"));

$view = mysql_fetch_array(mysql_query("SELECT * FROM downloads ORDER BY date DESC"));
Any help would be more than great .

thanks :)
 

PSS

Well-Known Member
#2
My guess is that first query result does not fit to allocated PHP memory (memory_limit) and it crashes the PHP process. I don't think Litespeed has anything to do it.
 
#3
didn't fix it. Although raising it "helped" a little or seemed to. I would say thats not the problem. and i'm sure script is fine becuase we had no problem with it before litespeed. i'm not saying that litespeed is the reason . i guess some configs are not correct which i have no idea what it can be .

any idea ?
 

PSS

Well-Known Member
#5
1. Do CHECK TABLE for all tables with phpmyadmin. If you see corrupted .MYI files repair those tables at least twice (yes!).
2. if above does not help, increase max temporary table size in my.cnf, e.g. : tmp_table_size=128M
3. check mysql error log for clues
4. Again, the result set must fit into php memory, if you do SELECT * make sure you know how much data you get.
 

mistwang

LiteSpeed Staff
#6
If you are using cPanel, you can try 3.3.23 package, cPanel impose a memory limit of 256MB, which will be passed to PHP processes running in non-suEXEC mode, it has been fixed in 3.3.23 release. Just change the version number in the download link to get it.
 
Top