24

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?

39

just do:

sudo apt-get install php5-sqlite

Next time, you can find it via:

apt-cache search php | grep sqlite
3
  • 3
    Thanks! Good to know how to search the package list via console. Didn't have cloue how to search for packets until now. – wowpatrick Aug 9 '11 at 15:42
  • @wowpatrick: you welcome. – Michał Šrajer Aug 10 '11 at 6:43
  • Don't forget to restart your Apache server: "sudo service apache2 restart". You can check if sqlite is installed through a php webpage with a call to phpinfo(); or through command line by running "php -m" – Jan Dec 16 '16 at 8:34
10

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

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

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

0
4

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

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.