tntsearch icon indicating copy to clipboard operation
tntsearch copied to clipboard

could not find driver

Open rajaunleashed opened this issue 5 years ago • 13 comments

I am getting this error in Laravel Screenshot_1

public function createIndex($indexName) { $this->indexName = $indexName;

    if (file_exists($this->config['storage'].$indexName)) {
        unlink($this->config['storage'].$indexName);
    }

    $this->index = new PDO('sqlite:'.$this->config['storage'].$indexName);
    $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    $this->index->exec("CREATE TABLE IF NOT EXISTS wordlist (
                id INTEGER PRIMARY KEY,
                term TEXT UNIQUE COLLATE nocase,
                num_hits INTEGER,
                num_docs INTEGER)");

    $this->index->exec("CREATE UNIQUE INDEX 'main'.'index' ON wordlist ('term');");

    $this->index->exec("CREATE TABLE IF NOT EXISTS doclist (
                term_id INTEGER,
                doc_id INTEGER,
                hit_count INTEGER)");

rajaunleashed avatar Aug 30 '19 11:08 rajaunleashed

What steps did you take to try to fix this error? Have you tried google on "PDO exception could not find driver"...?

stokic avatar Aug 30 '19 11:08 stokic

Yes I tried and also installed sqlite using this command for php7.3

sudo apt-get install php7.3-sqlite

But this error still comes up

rajaunleashed avatar Aug 30 '19 11:08 rajaunleashed

This is PDO error, ie driver missing, nothing to do with this package. Try to access/create an sqlite database with PDO in your project and it'll still not work.

stokic avatar Aug 30 '19 11:08 stokic

sqlite3 installed

What should I do now?

rajaunleashed avatar Aug 30 '19 12:08 rajaunleashed

Try to access/create an sqlite database with PDO in your project

stokic avatar Aug 30 '19 12:08 stokic

You should check that the driver is properly installed. CLI version and web version of PHP might be different

php -m | grep sqlite

nticaric avatar Aug 30 '19 12:08 nticaric

Screenshot_2

already installed

rajaunleashed avatar Aug 30 '19 12:08 rajaunleashed

Having the same problem, Pdo, sqlite and pdo_sqlite are all installed and enabled.

Naghal avatar Mar 10 '20 17:03 Naghal

same problem here

kriscologne avatar Mar 03 '21 18:03 kriscologne

The error is self explanatory

On Wed, 3 Mar 2021 at 19:33, kriscologne [email protected] wrote:

same problem here

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/teamtnt/tntsearch/issues/194#issuecomment-789961928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMGWXPE4D65UCPDQ5LTHTTBZ6IPANCNFSM4ISMOCRA .

stokic avatar Mar 03 '21 18:03 stokic

The error is self explanatory On Wed, 3 Mar 2021 at 19:33, kriscologne @.***> wrote: same problem here — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#194 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMGWXPE4D65UCPDQ5LTHTTBZ6IPANCNFSM4ISMOCRA .

It is clear that something is missing, but not clear what is missing because even after following the installation steps and verifying that everything is properly installed, the error shows up.

Naghal avatar Mar 03 '21 18:03 Naghal

It’s a PDO error, google the error message... means your are missing the pdo driver, sqlite one in your case

On Wed, 3 Mar 2021 at 19:42, Naghal [email protected] wrote:

The error is self explanatory … <#m_8402234453699819985_> On Wed, 3 Mar 2021 at 19:33, kriscologne @.***> wrote: same problem here — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#194 (comment) https://github.com/teamtnt/tntsearch/issues/194#issuecomment-789961928>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMGWXPE4D65UCPDQ5LTHTTBZ6IPANCNFSM4ISMOCRA .

It is clear that something is missing, but not clear what is missing because even after following the installation steps and verifying that everything is properly installed, the error shows up.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/teamtnt/tntsearch/issues/194#issuecomment-789967047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMGWRGX3NWCLXBFAKK563TBZ7H5ANCNFSM4ISMOCRA .

stokic avatar Mar 03 '21 18:03 stokic

same problem here

After installing the sqlite module for php with "sudo apt-get install php7.4-sqlite", and restart of the apache server solved it for me. hope this helps others.

kriscologne avatar Mar 03 '21 20:03 kriscologne