0

I've an Ubuntu Server 22.04 installed on VPS.

Then, I install a Apache + PHP and all works correctly at this moment: Commands used:
sudo apt-get install apache2 -y
sudo apt install mysql-server-8.0 -y
sudo apt install php libapache2-mod-php php-mysql -y

I try check if any issue on MySQL Server, and this services appear all OK.
Tests dids for get my idea:
Used mysql command and executed some queries like "CREATE DATABASE number1"
Created a user + remote access, login with that user via SQLYog 13.2 and do some queries

But, when an php website try use mysql, it returns de next error:

CDbConnection failed to open the DB connection: could not find driver



What's wrong on my Apache, why Web Applications can't connect to MySQL?

Best regards

1
  • 1
    Silly question, but did you remember to restart Apache after installing PHP and subsequent packages? 🤔
    – matigo
    Aug 14, 2022 at 21:56

1 Answer 1

-2

Try to install php-sqlite (drive)

sudo apt-get install phpX.Y-sqlite (replace x.y with your current PHP version) and after that restart apache's service.

sudo service apache2 restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .