sudo apt-get install php-sqlite3
SQLITE Database throw error could not find driver (SQL: PRAGMA foreign_keys = ON;)
Hello Everyone,
I am new in laravel and ubantu. i am trying to migrate my database using php artisan migrate command but i get error. i have already created a database/database.sqlite file. my .env file DB_CONNECTION=sqlite
BROADCAST_DRIVER=log CACHE_DRIVER=file QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120
Error:- PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20170718/pdo_sqlite (/usr/lib/php/20170718/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/pdo_sqlite.so (/usr/lib/php/20170718/pdo_sqlite.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Illuminate\Database\QueryException : could not find driver (SQL: PRAGMA foreign_keys = ON;)
at /var/www/html/frest-bootstrap-admin-template-html/frest-laravel-admin-template/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669 665| // If an exception occurs when attempting to run a query, we'll format the error 666| // message to include the bindings with SQL, which will make this exception a 667| // lot more helpful to the developer instead of just the database's errors. 668| catch (Exception $e) {
669| throw new QueryException( 670| $query, $this->prepareBindings($bindings), $e 671| ); 672| } 673|
Exception trace:
1 Doctrine\DBAL\Driver\PDOException::("could not find driver") /var/www/html/frest-bootstrap-admin-template-html/frest-laravel-admin-template/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31
2 PDOException::("could not find driver") /var/www/html/frest-bootstrap-admin-template-html/frest-laravel-admin-template/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27
Please use the argument -v to see more details.
Whoops\Exception\ErrorException : PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20170718/pdo_sqlite (/usr/lib/php/20170718/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/pdo_sqlite.so (/usr/lib/php/20170718/pdo_sqlite.so: cannot open shared object file: No such file or directory))
at Unknown:0 1|
Exception trace:
1 Whoops\Run::handleError("PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20170718/pdo_sqlite (/usr/lib/php/20170718/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/pdo_sqlite.so (/usr/lib/php/20170718/pdo_sqlite.so: cannot open shared object file: No such file or directory))", "Unknown") /var/www/html/frest-bootstrap-admin-template-html/frest-laravel-admin-template/vendor/filp/whoops/src/Whoops/Run.php:408
2 Whoops\Run::handleShutdown() [internal]:0
Please help me to solve this.
Please or to participate in this conversation.