Call to undefined function mysql_error()

#1
Hey all,

So I'm moving over from openlitespeed to the enterprise version. There have been some installation differences but I am now like 99% done.
They issue I am having is mysql will not operate. MySQLi and MySQLND are both installed and enabled.
I've tried with lsphp 7.2 - 7.4 with no luck. This worked fine under openlitespeed.

Usually this is a really easy issue to get past during a server setup. any insight would be much appreciated.

This is the steps I've taken:
Bash:
#Install litespeed
wget [URL]https://get.litespeed.sh[/URL]
sudo mv index.html litespeed.sh
sudo chmod +x litespeed.sh
sudo ./litespeed.sh KEY
#Choose chroot option

#Install php 7.4
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 011AA62DEDA1F085
sudo wget -O /etc/apt/trusted.gpg.d/lst_repo.gpg[URL='http://rpms.litespeedtech.com/debian/lst_repo.gpg'] http://rpms.litespeedtech.com/debian/lst_repo.gpg[/URL]
wget [URL='http://rpms.litespeedtech.com/debian/enable_lst_debain_repo.sh'] http://rpms.litespeedtech.com/debian/enable_lst_debain_repo.sh[/URL]
sudo chmod +x enable_lst_debian_repo.sh
./enable_list_debian_repo.sh
sudo apt-get install lsphp74 composer lsphp74-curl lsphp74-mysql
#To fix “error while loading shared library” errors (chroot):
ldd /usr/local/lsws/lsphp74/bin/lsphp
#Copy each missing to path /usr/local/lsws/lib

sudo ln -s /usr/local/lsws/lsphp74/bin/php /usr/bin/php

#WebAdmin console > Server > External App
#Name: lsphp74
#Address: uds://tmp/lshttpd/lsphp74.sock
#Command: $SERVER_ROOT/lsphp74/bin/lsphp
php -m
Code:
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
enchant
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
SimpleXML
soap
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
php -i snippet:
Code:
mysqli

MysqlI Support => enabled
Client API library version => mysqlnd 7.4.4
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0

Directive => Local Value => Master Value
mysqli.allow_local_infile => Off => Off
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/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off

mysqlnd

mysqlnd => enabled
Version => mysqlnd 7.4.4
Compression => supported
core SSL => supported
extended SSL => supported
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 86400
Collecting statistics => Yes
Collecting memory statistics => No
Tracing => n/a
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password
API Extensions => mysqli,pdo_mysql

PDO

PDO support => enabled
PDO drivers => mysql

pdo_mysql

PDO Driver for MySQL => enabled
Client API version => mysqlnd 7.4.4

Directive => Local Value => Master Value
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
 
#3
Yes I'm aware of the removal in php 7. I've gotten a little further. It seems mysqli is not available.
Wordpress' code checks for mysqli and if it does not find it, it falls back to mysql. So the real problem is mysqli.

The only clue I'm really getting here is that when I check out phpinfo I have a configuration section for mysqlnd but not mysqli. There is one for mysqli in php.ini and it is being loaded there too.

Any ideas?

Edit: As everything checks out as far as I can see I'm going to rebuild server without chroot and see if that helps.
 
Last edited:
#6
I have the same problem with LS ENT it is driving me crazy.
I use a google cloud enviroment.
OLS does work but as soon i switch to LS ENT i get this error.
i first uninstall OLS to install LS ENT.
i tried debian, Ubuntu 18.04 none works witj LS ENT?
 
#7
I'm using Enterprise on an Ubuntu 18.04 AWS instance. Disabling chroot was all I really needed to do. Most other things were the same as OLS.
 
#8
ah nice to hear that. i was also assuming it has something to do with chroot. But care to share what,which and/or where you disabled what ;)
problem occurs for me when i am configuring suexec on virtual host. i need to spawn for each virtual host a different user that runs the lsphp thread
 
#9
ah helpdesk solved it for me;

Settings virtual host:
Restrained: (before)Yes to No
External App Set UID Mode: (before) Server UID to DocRoot UID

now i can add a specific user in the virtualhosts externalapp and spawn the lsphp thread on a different user.
 
Top