hutch90
hutch90

Reputation: 351

Ubuntu 16 yii1 database connection errors

I was using yii1 on Ubuntu 14 and it was working fine. After upgrading to Ubuntu 16, I haven't been able to get a yii web application working.

After solving a threadsafe issue with apache/php, I am now stuck with the following database connection error:

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

I've been searching around online, but nothing I've encountered has solved my problem. Does anybody have any ideas, particularly those who have experience updating from Ubuntu 14 to 16 and using yii1?

Upvotes: 1

Views: 57

Answers (1)

Tyler Dawson
Tyler Dawson

Reputation: 296

The problem we had was that Ubuntu 16 had PHP 7.0 installed, and we didn't have the proper driver for that. We had to run:

sudo apt-get install php7.0-mysql

and restart the apache server. Hope that helps!

Upvotes: 1

Related Questions