CodeIgniter Forums
An Error Was Encountered - Invalid DB driver ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: An Error Was Encountered - Invalid DB driver ? (/showthread.php?tid=74881)



An Error Was Encountered - Invalid DB driver ? - jocm.aguiar - 11-19-2019

Hi,

I believe I have made all the necessary settings to work with mysql database in CI3 3.1.11 but I come across invalid drive, the server I use is Apache2, Mysql-server5.7.28, Php7.3 below follows my settings and error print:

File autoload.php, setup :
Code:
$autoload['libraries'] = array('database');

File database.php, setup :

Code:
$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'    => '',
    'hostname' => 'localhost',
    'username' => 'myuser',
    'password' => 'mypass',
    'database' => 'mydatabase',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);


File config.php, setup to session work with database :

Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_sessions';
$config['sess_expiration'] = 0;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;


error message -> An Error Was Encountered - Invalid DB driver ?


RE: An Error Was Encountered - Invalid DB driver ? - jreklund - 11-20-2019

Make an empty file containing only the following, looks like you haven't installed mysqli. Or you haven't activated it in your php.ini file.

Code:
<?php phpinfo(); ?>

And press CTRL+F and search for "mysqli".


RE: An Error Was Encountered - Invalid DB driver ? - jocm.aguiar - 11-21-2019

(11-20-2019, 11:15 AM)jreklund Wrote: Make an empty file containing only the following, looks like you haven't installed mysqli. Or you haven't activated it in your php.ini file.

Code:
<?php phpinfo(); ?>

And press CTRL+F and search for "mysqli".

Don't be this problem as it runs on an earlier version.


RE: An Error Was Encountered - Invalid DB driver ? - jreklund - 11-21-2019

Earlier version of what?