CodeIgniter Forums
sqlite3 connection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: sqlite3 connection (/showthread.php?tid=73138)



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


RE: sqlite3 connection - s4f3r - 07-09-2020

(03-24-2019, 12:35 PM)JoaoNinguem Wrote: SQLite3 is a PHP extension.
Find and open "php.ini", uncomment the SQLite extension, and then save it.
Restart server

--EDIT-- It worked for me.

Thanks a lot

R.