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
Step 1 :
For PHP5, use
sudo apt-get install php5-sqlite
For PHP7.0, use
sudo apt-get install php7.0-sqlite
For PHP7.1, use
sudo apt-get install php7.1-sqlite
For PHP7.2, use
sudo apt-get install php7.2-sqlite
For PHP7.3, use
sudo apt-get install php7.3-sqlite
Step 2 :
Restart Apache
sudo service apache2 restart
I had the same error. If you are on Windows, don't forget to uncomment php_sqlite3.dll
(and optionally php_pdo_sqlite.dll
) extension in php.ini
. Save php.ini
and start the script again.
(I added this answer to the question with the ubuntu
tag because this question is on the first place in google for the request php sqlite3 not found
).