0

It looks like my Laravel deliberately ignores API extensions set in my php.ini since I’m getting could not find driver (SQL: select * from ....

php.ini is configured properly and php artisan migrate works fine and I can see its job im my MySQL DB.

Trying to figure out what goes wrong I added phpinfo() into default route and saw this:

API Extensions = no value PDO drivers = no value

However, if I start project by php -S localhost:8000 -t public/ instead of php artisan serve the everything works fine and API Extensions has pdo_mysql and PDO drivers = mysql.

In both cases Loaded Configuration File is the same C:\php\php.ini

What's wrong with Laravel? PS. Laravel 5.5, php 7.1

zhekaus
  • 3,126
  • 6
  • 23
  • 46
  • Already Answer given Please check this link https://stackoverflow.com/questions/35240414/laravel-5-pdoexception-could-not-find-driver – Anand Choudhary Sep 29 '17 at 06:58

1 Answers1

0

Laravel uses the php cli's inbuilt server which can have a different set of enabled extensions than that of the server(fpm or otherwise). Make sure you are editing the correct php.ini this varies on each os and if using linux each distribution. So I can't give the location of your php.ini but there are multiple for any given installation. Usually one for the cli and one for the server bit. The php -S seems to behave the same as using a webserver at least for me

same php.ini is being used

Clive Makamara
  • 2,845
  • 16
  • 31