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.
Go in your XAMPP\php\php.ini
, modify it with a text editor
Search for ;extension=sqlite3
with CTRL + F
Remove the ;
to uncomment the line
Restart Apache to apply change
Now you are able to use Sqlite3 on XAMPP for Windows :D
Uncomment extension=sqlite3 in php.ini:
;extension=sqlite3
=>
extension=sqlite3
and restart Apache.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With