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
  #1  
Old 02-14-2012, 11:12 AM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
Default [Solved] Mysql cannot connect error after compiling php

Hello, I've been trying everything that I've read to do over the last few days and nothing has worked. I was able to install and compile php with litespeed successfully, but I just can't seem to get MySql to connect. I made sure to configure --with-mysql and I made sure that the socket = /var/lib/mysql/mysql.sock is the right location and specified in php.ini and my.conf. Also, when I login to phpmyadmin, I get this error: Cannot load mysql extension. Please check your PHP configuration.

Also, php info does not show a mysql module, though I see that mysql is working as I am able to "service mysqld restart" and it stops and starts fine. Even verified from "top" command. I do not have Cpanel. The only control panel that I'm using is Webmin and I don't even think there's an extension that makes Litespeed compatible. I am running CentOS and I compiled PHP v3.5.8 with APC and it compiled successfully.

What I can't figure out is that the very first time that I did a php compile and I opened my website, it loaded fine. Then I went to add the apc.so extension in the php.ini file, and then I started getting the cannot load mysql error. Don't know if that caused it or not, but I did remove the apc.so and mysql error still exists.

Any help would be very much appreciated because I have tried everything for several days now. Thanks.
Reply With Quote
  #2  
Old 02-14-2012, 11:33 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
check lsphp to see if mysql extension is included.
Quote:
/usr/local/lsws/fcgi-bin/lsphp5 -i | grep mysql
Reply With Quote
  #3  
Old 02-14-2012, 11:41 AM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
Here is the result: /usr/local/lsws/fcgi-bin/lsphp5 -i | grep mysql
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/mysql.so' - /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/pdo.so' - /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so' - /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/sqlite.so' - /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql.so' - /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/msql.so' - /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead in Unknown on line 0Configure 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'
mysql
MYSQL_SOCKET => /var/lib/mysql/mysql.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib64/mysql -lmysqlclient
mysql.allow_local_infile => On => On
mysql.allow_persistent => On => On
mysql.connect_timeout => 120 => 120
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_SOCKET => /var/lib/mysql/mysql.sock
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => no value => no value
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

Now what?
Reply With Quote
  #4  
Old 02-14-2012, 11:55 AM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
And here are the contents of my php.ini file:

PHP.INI CONTENTS:
allow_call_time_pass_reference = Off
allow_url_fopen = On
allow_url_include = Off
asp_tags = Off
auto_append_file =
auto_globals_jit = On
auto_prepend_file =
bcmath.scale = 0
default_mimetype = "text/html"
default_socket_timeout = 120
define_syslog_variables = Off
disable_classes =
disable_functions =
display_errors = Off
display_startup_errors = Off
doc_root =
enable_dl = On
engine = On
error_reporting = E_ALL
expose_php = On
extension_dir="/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/"
extension=apc.so
extension=msql.so
extension=pdo.so
extension=pdo_mysql.so
extension=pdo_sqlite.so
extension=sqlite.so
file_uploads = On
ifx.allow_persistent = On
ifx.blobinfile = 0
ifx.byteasvarchar = 0
ifx.charasvarchar = 0
ifx.default_host =
ifx.default_password =
ifx.default_user =
ifx.max_links = -1
ifx.max_persistent = -1
ifx.nullformat = 0
ifx.textasvarchar = 0
ignore_repeated_errors = Off
ignore_repeated_source = Off
implicit_flush = Off
include_path = ""./var/lib/php"
include_path = ".:/usr/local/lsws/lsphp5/lib/php"
log_errors = On
log_errors_max_len = 1024
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
max_execution_time = 30000000
max_input_time = 3000000
memory_limit = 480M
msql.allow_persistent = On
msql.max_links = -1
msql.max_persistent = -1
mssql.allow_persistent = On
mssql.compatability_mode = Off
mssql.max_links = -1
mssql.max_persistent = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.secure_connection = Off
mysql.allow_persistent = On
mysql.connect_timeout = 120
mysql.default_host =
mysql.default_password =
mysql.default_port =
mysql.default_socket =
mysql.default_user =
mysql.max_links = -1
mysql.max_persistent = -1
mysql.trace_mode = Off
mysqli.default_host =
mysqli.default_port =
mysqli.default_pw =
mysqli.default_socket =
mysqli.default_user =
mysqli.max_links = -1
mysqli.reconnect = Off
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.defaultbinmode = 1
odbc.defaultlrl = 4096
odbc.max_links = -1
odbc.max_persistent = -1
open_basedir = Off
output_buffering = 4096
output_handler = ob_gzhandler
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.ignore_notice = 0
pgsql.log_notice = 0
pgsql.max_links = -1
pgsql.max_persistent = -1
post_max_size = 1000M
precision = 14
register_argc_argv = Off
register_globals = Off
register_long_arrays = Off
report_memleaks = On
safe_mode = Off
safe_mode_allowed_env_vars = PHP_
safe_mode_exec_dir =
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_protected_env_vars = LD_LIBRARY_PATH
sendmail_path = /usr/sbin/sendmail -t -i
serialize_precision = 100
session.auto_start = 0
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.cache_expire = 180
session.cache_limiter = nocache
session.cookie_domain =
session.cookie_httponly =
session.cookie_lifetime = 0
session.cookie_path = /
session.entropy_file =
session.entropy_length = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.gc_probability = 1
session.hash_bits_per_character = 5
session.hash_function = 0
session.name = PHPSESSID
session.referer_check =
session.save_handler = files
session.save_path = "/var/lib/php/session"
session.serialize_handler = php
session.use_cookies = 1
session.use_trans_sid = 0
short_open_tag = On
SMTP = localhost
smtp_port = 25
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_enabled=1
soap.wsdl_cache_ttl=86400
socket = /var/lib/mysql/mysql.sock
sql.safe_mode = Off
sybase.allow_persistent = On
sybase.compatability_mode = Off
sybase.max_links = -1
sybase.max_persistent = -1
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybct.allow_persistent = On
sybct.max_links = -1
sybct.max_persistent = -1
sybct.min_client_severity = 10
sybct.min_server_severity = 10
tidy.clean_output = Off
track_errors = Off
unserialize_callback_func=
upload_max_filesize = 20M
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeent ry"
user_dir =
variables_order = "EGPCS"
y2k_compliance = On
zend.ze1_compatibility_mode = Off
zlib.output_compression = Off

Does anything need to be changed in order to improve functionality and/or performance? Any help or suggestions would be appreciated. Thanks.
Reply With Quote
  #5  
Old 02-14-2012, 11:57 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
comment out the line below in php.ini
Quote:
extension=apc.so
extension=msql.so
extension=pdo.so
extension=pdo_mysql.so
extension=pdo_sqlite.so

Last edited by webizen; 02-14-2012 at 11:59 AM.. Reason: added other *.so lines.
Reply With Quote
  #6  
Old 02-14-2012, 12:01 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
And here are the contents of my my.conf file:

MY.CONF CONTENTS:
big-tables
connect_timeout = 1200
datadir = /var/lib/mysql
default-storage-engine = InnoDB
interactive_timeout = 1200
join_buffer_size = 32M
key_buffer = 4096M
log=mysql.log
log-error=/var/log/mysqld.log
log-slow-queries = /var/log/mysqlslowqueries.log
long_query_time = 1
max_allowed_packet = 256M
max_connections = 2500
max_heap_table_size = 512M
myisam_sort_buffer_size = 1024M
open_files_limit = 16344
pid-file=/var/run/mysqld/mysqld.pid
query_cache_limit = 512M
query_cache_size = 2048M
query_cache_type = 1
read_buffer_size = 32M
read_rnd_buffer_size = 32M
skip-grant-tables
socket = /var/lib/mysql/mysql.sock
sort_buffer_size = 32M
symbolic-links=0
table_cache = 36272
thread_cache = 8192
thread_cache_size = 1024
thread_concurrency = 16
tmp_table_size = 1024M
user=mysql
wait_timeout = 3000

Also, along with the mysql issue I'm currently facing, I have a very large Joomla site and on this same site is a Magento store with 150,000 SKU's, so any performance optimizations to the above php.ini and my.conf file would be appreciated as I need all the help that I can get to increase speed due to the extremely large catalog. Thanks for any help you guys can provide.
Reply With Quote
  #7  
Old 02-14-2012, 12:04 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
Quote:
Originally Posted by webizen View Post
comment out the line below in php.ini
Thank you. Will this solve my problem?
Reply With Quote
  #8  
Old 02-14-2012, 12:07 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
I've commented out those lines in my php.ini file and restarted litespeed, apache, and mysql but the problem still remains. What should I do next?
Reply With Quote
  #9  
Old 02-14-2012, 12:13 PM
tdunford tdunford is offline
Member
 
Join Date: Feb 2012
Posts: 13
Also, should this line be in the php after compiling with litespeed:

include_path = ""./var/lib/php"

because this is also there:
include_path = ".:/usr/local/lsws/lsphp5/lib/php"

?
Reply With Quote
  #10  
Old 02-14-2012, 12:14 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,337
you have litespeed and apache running in parallel?
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:28 PM.



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