Ubuntu 18.04 WordPress - PHP Issue

#1
Hi,

My client website was working well on managed hosting (Php7.1 - Litespeed). But I migrated it to cloud VPS.

I have installed OLS and also lsphp73 via below command:
sudo apt install lsphp73-* -y

It is installed and configured successfully. Also, website files and its database are moved to the vps well. But I see below error after moving WP to the cloud VPS.
site is experiencing technical difficulties.

Logs:
Code:
 [STDERR] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/bilduswp/example.com/html/wp-includes/wp-db.php:1643
Stack trace:
#0 /home/bilduswp/example.com/html/wp-includes/wp-db.php(639): wpdb->db_connect()
#1 /home/bilduswp/example.com/html/wp-includes/load.php(427): wpdb->__construct('secret-dbname', 'example-pass...', 'example', 'localhost')
#2 /home/bilduswp/example.com/html/wp-settings.php(120): require_wp_db()
#3 /home/bilduswp/example.com/html/wp-config.php(90): require_once('/home/bilduswp/...')
#4 /home/bilduswp/example.com/html/wp-load.php(37): require_once('/home/bilduswp/...')
#5 /home/bilduswp/example.com/html/wp-blog-header.php(13): require_once('/home/bilduswp/...')
#6 /home/bilduswp/example.com/html/index.php(17): require('/home/bilduswp/...')
#7 {main}
thrown in /home/bilduswp/example.com/html/wp-includes/wp-db.php on line 1643
I tried everything to fix it but I couldn't. What is the issue? Can you please help me?
 
#3
Can you check phpinfo page see if database module has loaded?
Hi,

Thank you for reply. I tried;

1- One click OpenLiteSpeed installation with WP on Ubuntu 16.04 & 18.04
2- or install OLS from repo on Ubuntu
3- or install OLS from source on Ubuntu

Unfortunately, none of them are working. (VPS company: Vultr) The same error occurred: site is experiencing technical difficulties. As you say the database module has not loaded.

Anyway, I installed OLS and WordPress by following the same installation methods on CENTOS7. Now it is working well with lsphp73.

Thank you!
Best regards.
 
#4
I'm having the same issue. I am running Debian 10.1. I installed OpenLiteSpeed using the documentation from this page: https://openlitespeed.org/kb/install-ols-from-litespeed-repositories/ . I installed lsphp73 with almost all modules (including lsphp73-mysql). I get "The site is having technical difficulties" when installing Wordpress. The error log shows the mysql_connect function is not available. Isn't mysql_connect obsolete? I thought newer PHP versions work with mysqli_connect...anyway, do you know what the issue is? Why isn't this working?

OLS version: 1.5.8

Any help is much appreciated.

Thanks.
 
Top