1

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

Rok Dolinar
  • 976
  • 3
  • 13
  • 29

1 Answers1

3

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

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • This is it, CLI uses the 5.6.31 PHP version and of course I was editing the .ini file of 7.1.9 version. Works perfectly now, thank you! Will accept answer as correct soon as possible. – Rok Dolinar Aug 21 '18 at 13:34
  • 1
    ALso read the other answer I linked to will be useful if you want to use PHP7.1.9 as the PHP CLI version on a command prompt – RiggsFolly Aug 21 '18 at 13:37