Ubuntu PHP致命错误:在调用PHP脚本时调用..中的未定义函数mysqli_connect()

I run Ubuntu desktop 14.04 LTS (Trusty Tahr), and I am trying to setup Apache 2, MySQL server and PHP, but I keep gettin the following error:

PHP Fatal error: Call to undefined function mysqli_connect() in..

What I have done is these changes in the correct php.ini:

uncomment:

extension=msqli.so

set path aquired from phpinfo():

extension_dir = "./usr/lib/php5/20121212+lfs"

Why is the mysqli function to connect to the database still undefined?

In my case php5-mysql was missing from my Ubuntu server. After installing the package it is working fine with mysqli adapter.

sudo apt-get install php5-mysql

It resolved my CodeIgniter 3.0 mysqli connection valid.

running updates is usually recommended

sudo apt-get update

then install needed version

sudo apt-get install php5-mysql
sudo apt-get install php7.0-mysql
sudo apt-get install php7.1-mysql
sudo apt-get install php7.2-mysql

restart apache

sudo service apache2 restart