how to enable sqlite3 for php?

Moon picture Moon · Jun 4, 2009 · Viewed 228.2k times · Source

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");

Answer

Stacey Richards picture Stacey Richards · Jun 4, 2009

Try:

apt-get install php5-sqlite

That worked for me.