PDO driver seems ot be missing when running laravel migrations on Windows

  laravel, migration, mysql, pdo, php

I have a problem connecting Laravel to a MySQL database.

The project is not inside a docker/homestead virtual box, it’s directly on my PC running Windows 10 (sadly).

The .env file looks like that:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=simac
DB_USERNAME=root
DB_PASSWORD=

When I try to run the migrations with artisan migrate I get the following:

simacvendorlaravelframeworksrcIlluminateDatabaseConnectorsConnector.php:70
      PDOException::("could not find driver")

simacvendorlaravelframeworksrcIlluminateDatabaseConnectorsConnector.php:70
      PDO::__construct()

My PHP version is 7.4.1. I am hosting the database using XAMPP. I have changed the php.ini file (the extension=pdo_mysql is uncommented and the extension exists in the installation directory of PHP)

I have also ran php artisan config:cache

The similar questions on SO don’t solve the problem.

Source: Ask PHP

LEAVE A COMMENT