Search code examples
phpmysqllaravellocalhostwampserver

PDO, 'could not find driver' in laravel 7.20.0


I have a common problem in my laravel project.When I try to connect laravel with mysql database they say : "could not find driver". Driver not found

when I type php -m in cmd to search for php modules installed I can't find mysql,pgsql or sqlite. please, if you have a solution for this problem answer me, I tried a lot of solutions. N.B: I use wampSERVER 3.2.0 with mysql 3.8.18 and php 7.4.0


Solution

  • Click WAMPServer icon on system tray then click php.ini under PHP item. next find this lines:

    ;extension=pdo_mysql
    ;extension=mysqli
    

    and change them to these:

    extension=pdo_mysql
    extension=mysqli
    

    Then click on Restart All Services in WampServer menu