I got this error when starting my laravel project:
Illuminate Database QueryException
could not find driver
PRAGMA foreign_keys = ON;
I tried to remove the semicolon extension=pdo_mysql
in php.ini file from the xampp/php folder.
And remove the comments in .env file from
this
DB_CONNECTION=sqlite
#DB_HOST=127.0.0.1
#DB_PORT=3306
#DB_DATABASE=laravel
#DB_USERNAME=root
#DB_PASSWORD=
to
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
and got this error instead
select * from sessions where id = rJV8ccVLO8rJ0AsiiomdmMsg5FGKLNq5Asi646pd limit 1
This is the pict after i changed the .env file
It’s my first time learning laravel
Is there any solution?
2
Answers
Once you have editted .env file and entered the correct database details, run the migrations, it should create the sessions table and other related tables.
Simply run:
php artisan migrate
This should fix the second error you are getting.
set SESSION_DRIVER=file in .env file