简体   繁体   中英

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: 在此处输入图片说明

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: 在此处输入图片说明

The driver is obviously present: 在此处输入图片说明

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

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.yz 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.yz

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM