skip to Main Content

I got this error when starting my laravel project:

Illuminate  Database QueryException

could not find driver
PRAGMA foreign_keys = ON;

This is the pict

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


  1. 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.

    Login or Signup to reply.
  2. set SESSION_DRIVER=file in .env file

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search