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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > [Solved] Mysql cannot connect error after compiling php

Reply
 
Thread Tools Display Modes
  #11  
Old 02-14-2012, 12:17 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
I thought that was how it was supposed to be. I'll turn off apache and see if that solves the problem. Nope, problem remains. So I am not supposed to run apache alongside litespeed? As mentioned above, I have a very large magento store, so my ultimate goal here is to do whatever is necessary to increase speed and performance, so whatever you recommend I'll do as this is all new to me. Thanks.
Reply With Quote
  #12  
Old 02-14-2012, 12:31 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,338
Quote:
Originally Posted by tdunford View Post
I thought that was how it was supposed to be. I'll turn off apache and see if that solves the problem. Nope, problem remains. So I am not supposed to run apache alongside litespeed? As mentioned above, I have a very large magento store, so my ultimate goal here is to do whatever is necessary to increase speed and performance, so whatever you recommend I'll do as this is all new to me. Thanks.
it is ok to run apache and litespeed in parallel (on different ports) to make sure litespeed functions well before take over. you should build matching php in lsws first. according to your build command, mysql is built in php as static extension (--with-mysql=/usr), there is no need to put 'extension=mysql.so' in php.ini which triggers warning/error message as you reported earlier.

since those lines are commented, the error messages you reported should be gone. you should check /usr/local/lsws/logs/error.log and see any further error message regarding mysql connection failure.

regarding performance tuning/improvement, you should order Hourly Support (https://store.litespeedtech.com/store/cart.php?gid=5).

Last edited by webizen; 02-14-2012 at 12:35 PM..
Reply With Quote
  #13  
Old 02-14-2012, 12:35 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
Here's some additional information if it helps:
usr/local/lsws/fcgi-bin/lsphp5 -i
PHP: syntax error, unexpected '=' in /usr/local/lsws/lsphp5/lib/php.ini on line 156
phpinfo()
PHP Version => 5.3.8

Configure Command => './configure' '--prefix=/usr/local/lsws/lsphp5' '--with-mysqli' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--enable-simplexml' '--with-libdir=lib64' '--enable-suhosin' '--with-litespeed'
Server API => LiteSpeed V5.5
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lsws/lsphp5/lib
Loaded Configuration File => /usr/local/lsws/lsphp5/lib/php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20090626
PHP Extension => 20090626
Zend Extension => 220090626
Zend Extension Build => API220090626,NTS
PHP Extension Build => API20090626,NTS
Debug Build => no
Thread Safety => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => disabled
IPv6 Support => enabled
Registered PHP Streams => compress.zlib, php, file, glob, data, http, ftp, phar
Registered Stream Socket Transports => tcp, udp, unix, udg
Registered Stream Filters => zlib.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

mysql

MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => 5.5.20
MYSQL_MODULE_TYPE => external
MYSQL_SOCKET => /var/lib/mysql/mysql.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib64/mysql -lmysqlclient

Directive => Local Value => Master Value
mysql.allow_local_infile => On => On
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off

mysqli

MysqlI Support => enabled
Client API library version => 5.5.20
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0
Client API header version => 5.5.20
MYSQLI_SOCKET => /var/lib/mysql/mysql.sock

Directive => Local Value => Master Value
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
Reply With Quote
  #14  
Old 02-14-2012, 12:42 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
After making the changes, this is the error that I get when I try to access my home page: Database Error: Unable to connect to the database:The MySQL adapter "mysql" is not available.

And this is the error I get when I try to access phpmyadmin: Cannot load mysql extension. Please check your PHP configuration.

Suggestions?
Reply With Quote
  #15  
Old 02-14-2012, 03:51 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,338
is the error from apache or litespeed (on different port)?
Reply With Quote
  #16  
Old 02-14-2012, 06:12 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
The unable to connect error is when I try to access the development site's home page while running litespeed, with and without apache running. And the second error is on the phpmyadmin login page.

Info on Port 80: netstat -antlp | grep 80
tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN 26177/litespeed (ls
tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 26177/litespeed (ls
tcp 0 0 :::80 :::* LIST

Also, I do have the following on httpd.conf (not sure if it's relevant or not):
Listen 80
NameVirtualHost *:80
Reply With Quote
  #17  
Old 02-14-2012, 07:39 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
For anyone who is experiencing a similar problem, I solved it by locating all connections on Port 80 by using

lsof -i tcp:80

...from SSH terminal. Then kill all of those connections using

kill -9 <pid number>

Then I stopped apache

service httpd stop

Then I did a graceful restart of Litespeed from the Litespeed control panel. Now it works perfectly and I was able to login to phpmyadmin and Litespeed is registering on php info and all looks good.
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 01:23 AM.



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