[Resolved] LiteSpeed conversion broke sites.

Status
Not open for further replies.

Licensecart

Well-Known Member
#1
Hello guys,

A client of mine I was helping install litespeed has the following issues and I can't seem to find out how or why they are happening. The installation went well, the compiling went well and then Bam sites like Joomla & Wordpress don't work but say they can't connect to the database:

Error displaying the error page: Application Instantiation Error: Could not connect to MySQL.
I've looked in the configuration files and everything looks fine, the database is fine too.

The other issue is in the /usr/local/lsws/logs/error.log.2014_07_07 has loads and loads of these file permission restrictions for a lot of domains:

2014-07-07 15:29:30.049 [INFO] [78.139.33.130:49663-1#APVH_domain2] [APVH_domain2] file permission is restricted for script.
The domains have a 403 error with the above.
 

Licensecart

Well-Known Member
#3
Create a phpinfo() page under the site having problem, switch between Apache and LiteSpeed compare phpinfo() output.

I think LiteSpeed PHP is missing mysql modules, so cannot connect to MySQL. usually can be fixed by updating php.ini used by lsphp, assuming the mysql modules has been built in DSO mode.

For the 403 error, just set
http://www.litespeedtech.com/docs/webserver/config/security#restrictedScriptPermissionMask to 000.
Ah yeah the Litespeed Phpinfo is msising mysql on it's own. how can we compile Litespeed to install them modules?
 

mistwang

LiteSpeed Staff
#4
Need to rebuild PHP with configuration "--with-mysql=...", make sure the correct mysql client library devel package has been installed.
 

Licensecart

Well-Known Member
#5
Need to rebuild PHP with configuration "--with-mysql=...", make sure the correct mysql client library devel package has been installed.

Would it be --with-mysql=/var/lib/mysql/? Here's the Apache information:

upload_2014-7-8_0-59-5.png

It's a InterWorx server.

Nope not the above nor is it: --with-mysql=/usr/local/mysql/ :s

checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find MySQL header files under /usr/local/mysql/.
Note that the MySQL client library is not bundled anymore!
**ERROR** Could not configure PHP build
I seen a article about mysql-devel and tried installing that to see if I missed it:

[root@s1 /]# yum install mysql-devel
Loaded plugins: fastestmirror, rhnplugin
Loading mirror speeds from cached hostfile
* cloudlinux-base: repo.cloudlinux.com
* cloudlinux-updates: repo.cloudlinux.com
* cloudlinux-x86_64-server-6: cl-mirror.krystal.co.uk
* epel: ftp-stud.hs-esslingen.de
* remi: remi.schlundtech.de
* rpmforge: mirror1.hs-esslingen.de
Setting up Install Process
Package mysql-devel-5.5.38-1.el6.remi.x86_64 already installed and latest version
Nothing to do
 
Last edited:

NiteWave

Administrator
#8
I've read the phpinfo page, so it's php 5.4.30, and without "Configure Command"!

how about to build lsphp with --with-mysql=mysqlnd ?
 

Licensecart

Well-Known Member
#9
I've read the phpinfo page, so it's php 5.4.30, and without "Configure Command"!

how about to build lsphp with --with-mysql=mysqlnd ?
That completes but the error is still there:

Log: http://paste2.org/v85y9OLw

Error: Error displaying the error page: Application Instantiation Error: Could not connect to MySQL.

Apache MySQL:
upload_2014-7-8_3-52-33.png

LiteSpeed MySQL:

upload_2014-7-8_3-53-13.png
 
Last edited by a moderator:

Licensecart

Well-Known Member
#11
can you create a simple php page like
http://www.php.net/manual/en/function.mysql-connect.php
Example #1

to test if it's ok ?
Apache:

Code:
Connected successfully
LiteSpeed:

Code:
Warning: mysql_connect(): The server requested authentication method unknown to the client [mysql_old_password] in /chroot/home/username/domain/html/simplephp.php on line 2

Warning: mysql_connect(): The server requested authentication method unknown to the client in /chroot/home/username/domain/html/simplephp.php on line 2
Could not connect: The server requested authentication method unknown to the client
 

NiteWave

Administrator
#12
by google the error message, it looks the problem is:
"Your database server is set to use old passwords by default."
"mysqlnd cannot use it to connect to the MySQL server."

can you try --with-mysql=/usr --with-libdir=lib64 to recompile lsphp5.

also check the mysql client version installed on this server
#rpm -qa |grep -i mysql
 

Licensecart

Well-Known Member
#13
by google the error message, it looks the problem is:
"Your database server is set to use old passwords by default."
"mysqlnd cannot use it to connect to the MySQL server."

can you try --with-mysql=/usr --with-libdir=lib64 to recompile lsphp5.
You are a legend mate :D thank you that got the bleeder, you are a life saver.

also check the mysql client version installed on this server
#rpm -qa |grep -i mysql
[root@s1 ~]# rpm -qa |grep -i mysql
compat-mysql51-5.1.54-1.el6.remi.x86_64
mysql-devel-5.5.38-1.el6.remi.x86_64
php-mysql-5.4.30-1.el6.remi.x86_64
mysql-5.5.38-1.el6.remi.x86_64
mysql-server-5.5.38-1.el6.remi.x86_64
mysql-iworx-4.0.21-12.rhe6x.iworx.x86_64
mysql-libs-5.5.38-1.el6.remi.x86_64
perl-DBD-MySQL-4.013-3.el6.x86_64
 

Licensecart

Well-Known Member
#14
oh dam mate same sort of issue with mysqli

Apache:
upload_2014-7-8_7-16-51.png

LiteSpeed:
upload_2014-7-8_7-17-32.png

I tried this:

Code:
--with-zlib --with-gd --enable-shmop --enable-track-vars --enable-sockets --enable-sysvsem --enable-sysvshm --enable-mbstring --with-iconv --with-mysql=/usr --with-libdir=lib64 --with-mysqli=/var --with-libdir=lib
 
Last edited:

NiteWave

Administrator
#15
I think "--with-mysqli=/var" is invalid, so it's replaced by default --with-mysqli=mysqlnd for php 5.4.x.

what "Client API version" shows in phpinfo under litespeed after you re-compile it with --with-mysql=/usr ?
if it shows 5.5.38 which is same as apache, the issue should be gone
 

Licensecart

Well-Known Member
#16
I think "--with-mysqli=/var" is invalid, so it's replaced by default --with-mysqli=mysqlnd for php 5.4.x.

what "Client API version" shows in phpinfo under litespeed after you re-compile it with --with-mysql=/usr ?
if it shows 5.5.38 which is same as apache, the issue should be gone
Hello mate yes that shows up 5.5.38 on the mysql one just the mysqli issue I'm going to try now :)

Ok that completes:

upload_2014-7-8_13-33-45.png


But the site's using mysqli are still broken on LiteSpeed:

Warning: mysqli::mysqli(): The server requested authentication method unknown to the client [mysql_old_password] in /chroot/home/username/domain/html/system/database/mysqli.php on line 6

Warning: mysqli::mysqli(): (HY000/2054): The server requested authentication method unknown to the client in /chroot/home/username/domain/html/system/database/mysqli.php on line 6

Fatal error: Uncaught exception 'ErrorException' with message 'Error: Could not make a database link (2054) The server requested authentication method unknown to the client' in /chroot/home/username/domain/html/system/database/mysqli.php:9 Stack trace: #0 /chroot/home/username/domain/html/system/library/db.php(13): DBMySQLi->__construct('localhost', 'username_faliop...', 'password', 'username_faliop...') #1 /chroot/home/username/domain/html/index.php(40): DB->__construct('mysqli', 'localhost', 'username_faliop...', 'password', 'username_faliop...') #2 {main} thrown in/chroot/home/username/domain/html/system/database/mysqli.php on line 9
 
Last edited:

mistwang

LiteSpeed Staff
#19
check output of "rpm -ql mysql-devel", it should give the path to mysql_config
use that path minus "/bin/mysql_config" for "--with-mysqli" configuration.
 

Licensecart

Well-Known Member
#20
check output of "rpm -ql mysql-devel", it should give the path to mysql_config
use that path minus "/bin/mysql_config" for "--with-mysqli" configuration.
That posted:

[root@s1 ~]# rpm -ql mysql-devel
/usr/include/mysql
/usr/include/mysql/decimal.h
/usr/include/mysql/errmsg.h
/usr/include/mysql/keycache.h
/usr/include/mysql/m_ctype.h
/usr/include/mysql/m_string.h
/usr/include/mysql/my_alloc.h
/usr/include/mysql/my_attribute.h
/usr/include/mysql/my_compiler.h
/usr/include/mysql/my_config.h
/usr/include/mysql/my_config_x86_64.h
/usr/include/mysql/my_dbug.h
/usr/include/mysql/my_dir.h
/usr/include/mysql/my_getopt.h
/usr/include/mysql/my_global.h
/usr/include/mysql/my_list.h
/usr/include/mysql/my_net.h
/usr/include/mysql/my_pthread.h
/usr/include/mysql/my_sys.h
/usr/include/mysql/my_xml.h
/usr/include/mysql/mysql
/usr/include/mysql/mysql.h
/usr/include/mysql/mysql/client_plugin.h
/usr/include/mysql/mysql/innodb_priv.h
/usr/include/mysql/mysql/plugin.h
/usr/include/mysql/mysql/plugin_audit.h
/usr/include/mysql/mysql/plugin_auth.h
/usr/include/mysql/mysql/plugin_auth_common.h
/usr/include/mysql/mysql/plugin_ftparser.h
/usr/include/mysql/mysql/psi
/usr/include/mysql/mysql/psi/mysql_file.h
/usr/include/mysql/mysql/psi/mysql_thread.h
/usr/include/mysql/mysql/psi/psi.h
/usr/include/mysql/mysql/psi/psi_abi_v1.h
/usr/include/mysql/mysql/psi/psi_abi_v2.h
/usr/include/mysql/mysql/service_my_snprintf.h
/usr/include/mysql/mysql/service_thd_alloc.h
/usr/include/mysql/mysql/service_thd_wait.h
/usr/include/mysql/mysql/service_thread_scheduler.h
/usr/include/mysql/mysql/services.h
/usr/include/mysql/mysql/thread_pool_priv.h
/usr/include/mysql/mysql_com.h
/usr/include/mysql/mysql_embed.h
/usr/include/mysql/mysql_time.h
/usr/include/mysql/mysql_version.h
/usr/include/mysql/mysqld_ername.h
/usr/include/mysql/mysqld_error.h
/usr/include/mysql/plugin.h
/usr/include/mysql/plugin_audit.h
/usr/include/mysql/plugin_ftparser.h
/usr/include/mysql/sql_common.h
/usr/include/mysql/sql_state.h
/usr/include/mysql/sslopt-case.h
/usr/include/mysql/sslopt-longopts.h
/usr/include/mysql/sslopt-vars.h
/usr/include/mysql/typelib.h
/usr/lib64/mysql/libmysqlclient.so
/usr/lib64/mysql/libmysqlclient_r.so
/usr/share/aclocal/mysql.m4
So based on that would it be this mate: --with-mysqli=/usr/include/ or --with-mysqli=/usr --with-libdir=include
 
Status
Not open for further replies.
Top