Home > database >  How to install php extension on Macbook pro M1 chipset?
How to install php extension on Macbook pro M1 chipset?

Time:01-08

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.

CodePudding user response:

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

CodePudding user response:

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

;extension=pdo_mysql

CodePudding user response:

Thank you Alper for your reply but It didn't work.

I've got the following error:

➜ ~ brew install php-mysql

Warning: No available formula with the name "php-mysql".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
  •  Tags:  
  • Related