Artisan migrate could not find driver

前端 未结 11 831
情话喂你
情话喂你 2020-11-27 17:33

I am trying to install Laravel. I have installed Xampp, but when I try to setup my database using php artisan migrateI get the error:

11条回答
  •  攒了一身酷
    2020-11-27 18:06

    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.

提交回复
热议问题