tntsearch
tntsearch copied to clipboard
could not find driver
I am getting this error in Laravel
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)");
What steps did you take to try to fix this error? Have you tried google on "PDO exception could not find driver"...?
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
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.
What should I do now?
Try to access/create an sqlite database with PDO in your project
You should check that the driver is properly installed. CLI version and web version of PHP might be different
php -m | grep sqlite
already installed
Having the same problem, Pdo, sqlite and pdo_sqlite are all installed and enabled.
same problem here
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 .
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.
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 .
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.