Solution to MySQL and LiteSpeed connect prob on CentOS
I had the same problem: MySQL 5 and LiteSpeed do not work together out-of-the-box, at least on a default, vanilla CentOS 5 install.
The default LiteSpeed (compiled) PHP config is telling PHP that MySQL's UNIX socket is at:
/tmp/mysql.sock
When in fact it should be (the default on my CentOS 5 server):
/var/lib/mysql/mysql.sock
To change it: edit:
/opt/lsws/php/php.ini
and under the
[MySQL] section, change it as follows:
Code:
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =/var/lib/mysql/mysql.sock
It worked for me.
It was a bit confusing though to track this down - there are at least *3* php.ini files floating around under the /opt/lsws directory.
Figuring out which one was active was only revealed (of course) by looking at the phpinfo output.