LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > Mysql Database Connectivity Issue

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2007, 10:38 AM
MaxX MaxX is offline
New Member
 
Join Date: Jan 2007
Posts: 8
Default Mysql Database Connectivity Issue

Hi,

I have installed LiteSpeed on my server. Currently I have apache/cpanel and I followed all the wiki's (I selected to NOT import the apache config during installation) and installed LiteSpeed, loaded the apache config in the control panel and also compiled lsphp according to the other wiki.

MySQL does not connect for some reason.

I have set a 1000 port offset and both my portal and forums do not connect to database.

For eg. http://www.funonthenet.in:1080/forums/ (Thats the error it gives when it cannot connect to database) although regular apache works fine - http://www.funonthenet.in/forums/

I configured PHP with the SAME options.. see phpinfo -

http://www.funonthenet.in:1080/phpinfo.php

and of Apache - http://www.funonthenet.in/phpinfo.php

I know thats its some PHP/MySQL issue, but I cant fathom what it is, as everything is followed to the dot and I retried multiple times..
Reply With Quote
  #2  
Old 01-02-2007, 10:48 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
You need to fix the default MySQL Socket address, in Apache it is /var/lib/mysql/mysql.sock, in LSWS it is /var/tmp/mysql.sock.

lsphp could not find a valid php.ini, maybe due to permission problem. Anyway, you can change the commnd of lsphp external app to give the path of php.ini with command line option "lsphp -c <path_to_php.ini>".
Reply With Quote
  #3  
Old 01-02-2007, 08:23 PM
MaxX MaxX is offline
New Member
 
Join Date: Jan 2007
Posts: 8
Quote:
Originally Posted by mistwang View Post
You need to fix the default MySQL Socket address, in Apache it is /var/lib/mysql/mysql.sock, in LSWS it is /var/tmp/mysql.sock.

lsphp could not find a valid php.ini, maybe due to permission problem. Anyway, you can change the commnd of lsphp external app to give the path of php.ini with command line option "lsphp -c <path_to_php.ini>".
I changed the MySQL Socket Address in php.ini as such-

mysql.default_socket = /var/tmp/mysql.sock

I even tried the -c statement above but it does not seem to help..

I also reinstalled LiteSpeed into /usr/local/lsws.. but the issue remains..

I use CentOS 4 and MySQL 4.1
Reply With Quote
  #4  
Old 01-02-2007, 08:55 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
which php.ini do you use?
You should use /usr/local/lib/php.ini as lsws/conf/php.ini may not be available when php started in suexec mode as lsws/conf has permission 0700.
Reply With Quote
  #5  
Old 01-02-2007, 09:25 PM
MaxX MaxX is offline
New Member
 
Join Date: Jan 2007
Posts: 8
Quote:
Originally Posted by mistwang View Post
which php.ini do you use?
You should use /usr/local/lib/php.ini as lsws/conf/php.ini may not be available when php started in suexec mode as lsws/conf has permission 0700.
The php suexec is set as N/A.

Anyway in external apps/command I modified the command to $SERVER_ROOT/fcgi-bin/lsphp -c /usr/local/lib/php.ini

Now PHP itself has stopped working!

I get a 503 Service unavailable

Last edited by MaxX; 01-02-2007 at 09:37 PM..
Reply With Quote
  #6  
Old 01-02-2007, 09:28 PM
MaxX MaxX is offline
New Member
 
Join Date: Jan 2007
Posts: 8
Also if I just run lsphp from shell prompt -

./lsphp -c /usr/local/lsws/conf/php.ini -i | less

Then it loads the configuration properly (eaccelerator is present and mysql values are correct from config)

Why cant the server do the same?

Last edited by MaxX; 01-02-2007 at 09:38 PM..
Reply With Quote
  #7  
Old 01-02-2007, 09:43 PM
MaxX MaxX is offline
New Member
 
Join Date: Jan 2007
Posts: 8
Actually I just noted that from the shell prompt if I JUST run lsphp also it works properly..

root@server [/usr/local/lsws/fcgi-bin]# ./lsphp -i | less

(loads correct config)

[update]

I reinstalled PHP.. but the thing refuses to work (load the php.ini). I even removed all relative paths (of eaccelerator from php.ini)

From the shell prompt if I give /usr/local/lsws/fcgi-bin/lsphp -i |less I can see that it loads the php.ini perfectly, but the server cant do that!

Last edited by MaxX; 01-02-2007 at 10:36 PM..
Reply With Quote
  #8  
Old 01-02-2007, 10:37 PM
MaxX MaxX is offline
New Member
 
Join Date: Jan 2007
Posts: 8
So this is the stage Im in now-

I am using the php from /usr/local/lib/php2.ini (I copied the litespeed php to here).

It loads it fine, all values show up, even eaccelerator.

http://www.funonthenet.in:1080/phpinfo.php

But MySQL connection still does not work.

Any advise?
Reply With Quote
  #9  
Old 01-03-2007, 12:11 AM
MaxX MaxX is offline
New Member
 
Join Date: Jan 2007
Posts: 8
I fixed it myself after pouring through tons of manuals... MySQL 4.1/5 uses new authentication methods.. your wiki's are horribly outdated! (and it seems that users cant update it..)
Reply With Quote
  #10  
Old 01-03-2007, 08:32 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Glad to know that you fixed it.

It is always recommended to build php with the mysql client library installed on your system.

You should be able to update the wiki with your forum login, as I knew.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:10 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.