PHP CLI MySQLi database driver issue detected

by Fo.   Last Updated June 18, 2019 04:00 AM - source

I'm trying to execute a PHP script on the CLI on Amazon Linux 2 and though I have mysqli installed I'm repeatedly getting this error:

!!! <p>Error: database driver problem detected</p>
<p>The site administrator should verify server configuration</p><p>PHP has not been properly configured with the MySQLi extension for it to communicate with MySQL. Please check your php.ini file or recompile PHP.</p> !!!

But this:

$ php -m |grep mysql
mysqli
mysqlnd
pdo_mysql

and the application (Moodle) seems to be connecting fine to the database through the browser. What could the problem be?



Related Questions


Apache 2.4 fails to start -- without any errors

Updated December 06, 2017 16:00 PM

Amazon Linux ODBC driver not working

Updated November 22, 2018 18:00 PM

CentOS 7 + PHP7 — php not rendering in browser

Updated October 04, 2018 09:00 AM

Moodledata on EFS

Updated July 10, 2017 08:00 AM