1

I've a macbook pro with M1 chipset, I'm testing a Laravel web-app with Sanctum Api authentication.

First I send a GET requesto to /sanctum/csrf-cookie to get the cookies, then I send a POST request to the /login endpoint I get the following error:

Illuminate\Database\QueryException: could not find driver (SQL: select * from "users" where "email"

I wonder what is the problem. Anyone can help me? Thank you for any reply.

netnull
  • 201
  • 1
  • 3
  • 13

2 Answers2

0

it's clear, "could not find driver".

you should try

brew install php-mysql

or you can check this link

edit:

Apparently, this command is not working. I am not on macOS, sorry for that. But you should google "how to activate a php extension on macos" I think. you should activate mysql and PDO extensions.

  • a solution is this package
  • another solution is finding php.ini and uncomment mysql and pdo extensions.
  • another solution is this link
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Alper
  • 152
  • 1
  • 7
0

You should enable the pdo_mysqli extension in the php.ini file. Remove ";" from the start of the line.

;extension=pdo_mysql