25

The default Ubuntu PHP package does not include the PDO SQLite extension. How can I install the SQLite PDO extension? Is there a package that one can easily install via apt-get?

wowpatrick
  • 4,559

5 Answers5

41

just do:

sudo apt-get install php5-sqlite

Next time, you can find it via:

apt-cache search php | grep sqlite
12

Just for clarification, I recently got into this issue, for php7.2 I had to run

sudo apt-get install php-sqlite3

which did install sqlite-3 there was no package named php-sqlite

Shobi
  • 221
10

In ubuntu 16.04 there is no php5-sqlite. You need:

sudo apt-get install php7.0-sqlite
sudo service apache2 restart
4

php5-sqlite - SQLite module for php5 php-mdb2-driver-sqlite - PHP PEAR module to provide a SQLite driver for MDB2

sac
  • 41
  • 1
2

First check your php version:

php -v

Then install the extension:

sudo apt-get install php[version-here]-sqlite3

For example, for PHP 7.2:

sudo apt-get install php7.2-sqlite3

Restart your apache server:

sudo service apache2 restart

List the modules and it should print sqlite:

php -m | grep sqlite
Parzibyte
  • 121