2

Ubuntu with php7

Error occurs when trying to use SQLite3 from php:

PHP Fatal error:  Class 'SQLite3' not found in /var/www/html/index.php on line 1

I've tried to install php7.0-sqlite3 :

$ sudo apt-get install php7.0-sqlite3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-sqlite3
E: Couldn't find any package by regex 'php7.0-sqlite3'

Apparently the package is missing:

$ sudo apt-cache search php7.0-*
php7.0-mysql - MySQL module for PHP
php7.0-readline - readline module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0 - server-side, HTML-embedded scripting language (metapackage)
libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.0-json - JSON module for PHP
php7.0-common - documentation, examples and common module for PHP    

How to add the package ?

13

Try sudo apt-get install php-sqlite3

The package was kept this way during the migration to prevent any issues with sqlite3 going past 7.1

5
  • I've tried sudo apt-get install php-sqlite3.. Unable to locate package Dec 16 '16 at 22:30
  • 1
    Can you try sudo apt-get update and try again?
    – CeFu
    Dec 16 '16 at 22:31
  • Still unable to locate package Dec 16 '16 at 22:35
  • Try running sudo apt-get autoclean, perform another update, and search for php-sqlite3 with sudo apt-cache search php-sqlite3
    – CeFu
    Dec 16 '16 at 22:41
  • 2
    doesn't help still the same problem Dec 17 '16 at 0:43

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.