If You face this problem
(could not find driver (SQL: PRAGMA foreign_keys = ON;))
You can simply run bellow command on your Ubuntu system
sudo apt-get install php-sqlite3
Also if you want to install specific version like php 8.1 simply run bellow command
sudo apt install php8.1-sqlite3
You might need to enable pdo_sqlite extension in your php.ini too, you can get the path of your loaded ini with the below command:
php --ini
simply add extension=pdo_sqlite to your php.ini and verify it is loaded by running
php -m | grep pdo_sqlite
I think it will help you.. Thanks