I'm on Windows 7, using PHP Version 5.6.14 on Apache 2.4 and I'm trying to access to a SQLite3 database.
I'm obtaining ....
Fatal error: Class 'SQLite3' not found
Here you're a simple php code ...
<?php
$db = new SQLite3('phpdb');
if ($db) {
$db->query("CREATE TABLE dogbreeds (Name VARCHAR(255), MaxAge INT);");
$db->query("INSERT INTO dogbreeds VALUES ('Doberman', 15)");
$result = $db->query("SELECT Name FROM dogbreeds");
var_dump($result->fetchArray(SQLITE3_ASSOC));
} else {
print "Connection to database failed!\n";
}
?>
I've just looking for information about and based on this at the moment I've this configuration in my php.ini file ...
extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll
sqlite3.extension_dir = "D:\Cesare\Lavoro\Utili\Php\5-6-14\ext"
Any suggestions? Thank you very much in advance ....
Cesare
Enable extension php by removing the ";" in front of ";extension=php_sqlite3.dll" in php.ini. Can you also manually check if the extensions are there in the path?
`extension=php_pdo_sqlite.dll` AND `extension=php_sqlite3.dll`.
Try this
$db = sqlite_open("/absolute/path/my_sqlite.db");
or
$db = new SQLiteDatabase('filename'))
http://php.net/manual/en/book.sqlite.php
I met the same problem, I solved it by changing the "extension_dir" using the absolute path
extension_dir = "C:/php/php7.0/ext"
the others setting
extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll
sqlite3.extension_dir = "C:/php/php7.0/ext"
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