CodeIgniter Forums
sqlite3 connection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: sqlite3 connection (/thread-73138.html)



sqlite3 connection - luk3b8 - 03-22-2019

Hi everyone,
I can't find out what's the problem whit my sqlite3 connection
This is my configuration:

PHP Code:
    public $sqlite = [
        'DSN'    => '',
        'hostname' => 'localhost',
        'username' => '',
        'password' => '',
        'database' => APPPATH 'Database/mydb.sql3',
        'DBDriver' => 'SQLite3',
        'DBPrefix' => '',
        'pConnect' => false,
        'DBDebug'  => (ENVIRONMENT !== 'production'),
        'cacheOn'  => false,
        'cacheDir' => '',
        'charset'  => 'utf8',
        'DBCollat' => '',
        'swapPre'  => '',
        'encrypt'  => false,
        'compress' => false,
        'strictOn' => false,
        'failover' => [],
        'port'     => 3306,
    ]; 

When I run
$query = $builder->get();
I have this response:
Error
Class 'SQLite3' not found

PHP Code:
86             return (! $this->password)
87                 ? new \SQLite3($this->database)
88                 : new \SQLite3($this->databaseSQLITE3_OPEN_READWRITE SQLITE3_OPEN_CREATE$this->password);
89         

Some idea?
Thanks.

Luk


RE: sqlite3 connection - JoaoNinguem - 03-24-2019

SQLite3 is a PHP extension.
Find and open "php.ini", uncomment the SQLite extension, and then save it.
Restart server