Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xampp v3.2.4 enabling sqlite3 (WINDOWS 10) 64bit

Tags:

sqlite

xampp

I've setup xampp on my windows machine, and I'm trying to use the sqlite3 module with php 7.4.3

I've edited my php.ini file and adjusted the extension=sqlite3 and restarted the service. When i try and run this:

<?php
$db = new SQLite3('test.db');
?>

I get this error:

Fatal error: Uncaught Error: Class 'SQLite3' not found

I've also tried using pdo:

$db = new PDO("sqlite:".__DIR__."/test.db");

And with that i get this error instead:

Fatal error: Uncaught PDOException: could not find driver

Now I'm sure i have the sqlite3 ext because when i check the php/ext folder i can see the php_sqlite3.dll I haven't changed anything else in the php.ini regarding the dir for the ext but im sure it's all setup correctly since all the other extensions are working just fine. Maybe I'm just being ignorant and I'm using sqlite3 incorrectly so please if someone knows the problem enlighten me.

like image 576
Teka Avatar asked Oct 17 '25 14:10

Teka


2 Answers

  1. Go in your XAMPP\php\php.ini, modify it with a text editor

  2. Search for ;extension=sqlite3 with CTRL + F

  3. Remove the ; to uncomment the line

  4. Restart Apache to apply change

Now you are able to use Sqlite3 on XAMPP for Windows :D

like image 99
Christophe Ménard Avatar answered Oct 21 '25 13:10

Christophe Ménard


Uncomment extension=sqlite3 in php.ini:

;extension=sqlite3

=>

extension=sqlite3

and restart Apache.

like image 31
Haddad Avatar answered Oct 21 '25 13:10

Haddad