Rok Dolinar
Rok Dolinar

Reputation: 1006

Laravel - could not find driver when migrating

Hello I'm using latest version of Laravel, PHP 7.1.9 and MySQL 5.7.19. I'm also using WAMP stack.

When I run the command:

php artisan migrate

I get the following error: enter image description here

I googled a lot and I' m 100% sure my php.ini file does not have the driver line commented out and the driver is properly working, as seen here: enter image description here

The driver is obviously present: enter image description here

Also the path to extension dir is absolute:

extension_dir ="c:/wamp64/bin/php/php7.1.9/ext/"

What else can I do? This thing is driving me crazy

Upvotes: 1

Views: 1407

Answers (1)

RiggsFolly
RiggsFolly

Reputation: 94682

There are 2 php.ini files in the WAMPServer implementation.

One for APACHE which is the one accessed from the menu system and one in each wamp\bin\php\phpx.y.z folder

As you are using the PHP CLI you have to check that all the required extensions are also activated in PHP you are using for the CLI wamp\bin\php\phpx.y.z

Do this from the command line

php --ini

It should show you something like this

Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File:         C:\wamp64\bin\php\php7.0.29\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

Look at this param Loaded Configuration File: to see which php.ini file you should be checking.

This post may also be useful to you for making a batch file to run from the command prompt to switch easily from one version of PHP CLI to another from the command window How To Run PHP From Windows Command Line in WAMPServer

Upvotes: 3

Related Questions