1
votes

I have installed php7.2, apache and mysql. When I copied codeigniter folder in my var/www/html it runs but give one error as

A PHP Error was encountered

Severity: Core Warning

Message: PHP Startup: Unable to load dynamic library 'php_mysqli' (tried: /usr/lib/php/20170718/php_mysqli (/usr/lib/php/20170718/php_mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/php_mysqli.so (/usr/lib/php/20170718/php_mysqli.so: cannot open shared object file: No such file or directory))

Filename: Unknown

Line Number: 0

Backtrace:

I search for the same and tried with different solution as updating php.ini file but still getting the same error.

I am using Ubuntu 18.04.1 LTS OS

Your help would be appreciated. Thanks.

2
This is a PHP issue and not CodeIgniter. See this SO questionDFriend
Make sure that you installed lamp stack correctly and added all required dependencies.Sherif Salah
have you installed php7.2-mysql? and restarted server after installation?user969068

2 Answers

2
votes

Install php extension for mysql.

use this command

sudo apt-get install php-mysql

After installation restart apache with this command

sudo service apache2 restart

update

If sudo apt-get install php-mysql

not work for you then you should use

sudo apt-get install php7.2-mysql
0
votes

You should open php.ini file and check if the line:

 extension=mysqli.so 

presented and not commented with # sign