Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to enable sqlite3 for php?

Tags:

php

sqlite

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"); 
like image 241
Moon Avatar asked Jun 04 '09 06:06

Moon


People also ask

Does PHP support sqlite3?

PHP provides two SQLite extensions by default since version 5.0. The latest SQLite extension is known as sqlite3 extension that is included in PHP 5.3+.

How uncomment sqlite3 in PHP INI?

If you are using XAMPP click on "config" button select PHP(php. ini) then search "sqlite3" uncomment the ;extension=sqlite3 like this, extension=sqlite3 then find [sqlite3] and write the path where your php file and sqlite database reside like, [sqlite3] sqlite3.


1 Answers

Try:

apt-get install php5-sqlite 

That worked for me.

like image 120
Stacey Richards Avatar answered Sep 21 '22 16:09

Stacey Richards