Im using ubuntu 12.04, and php 5.x I need to use sqlite3 in it but Im getting an error of
php fatal error: class sqlite3 not found
I done
For php5.6 use:
sudo apt-get install php5.6-sqlite3
I had the same problem even I have installed all libraries. If you run php-fcgi, you should restart it:
sudo service php-fcgi restart
Try also restart apache:
sudo service apache restart
For the error PHP Fatal error: Uncaught Error: Class 'SQLite3' not found in /path/file.php:1
on ArchLinux:
Install the sqlite extension for PHP:
$ sudo pacman -S php-sqlite
Then edit /etc/php/php.ini
and add:
extension=pdo_sqlite
extension=sqlite3
Source: 1
Found a solution my self,
I installed
$ sudo apt-get install php5-sqlite
not
$ sudo apt-get install php5-sqlite3
and using sqlite3 class only.. no issue now.
My PHP is 7.3 so I used the following
For PHP7.3, use
sudo apt install php7.3-sqlite3
And don't forget to restart your Apache2
sudo service apache2 restart
In order to install the missing class sqlite3, please run:
apt-get install php7.4-sqlite3