I am trying to install sqlite3 for PHP in Ubuntu.
I install apt-get php5-sqlite3
and edited php.ini
to include sqlite3 extension.
When I run phpinfo();
I get
SQLITE3
SQLite3 support enabled
sqlite3 library version 3.4.2
as shown above, sqlite3
is enabled. However, I get "Class SQLite3 not found" when I use
new SQLite3("database");
Only use:
and later
The accepted answer is not complete without the remainder of instructions (paraphrased below) from the forum thread linked to:
The SQLite3 PDO driver is named SQLite, not SQLite3, so you can do:
For a SQLite2 database:
For PHP7, use
and restart Apache
try this: