I am trying to install Laravel. I have installed Xampp
, but when I try to setup my database using php artisan migrate
I get the error:
I know this is a little late, nevertheless i'm answering this for anyone still experiencing this issue on windows (USING XAMPP).
Step 1. Verify that there is a mismatch in your PHP version. To do this, open routes/web.php and create a simple route to return the php information like so:
Route::get('/', function() {
return response()->json([
'stuff' => phpinfo()
]);
})
and compare this with output from your command line
As we can see, in my case there is a mismatch, this usually happens if you have multiple versions of php installed.
Step 2. Add the php version being used by your xampp to your system path
Step 3. Verify that you have the extension enabled in your php.ini file. NB. Make sure you are editing the php.ini file that is shown under the 'loaded configuration file' entry in the results of phpinfo() command.