Laravel 7.20.0 中的 PDO,“找不到驱动程序" [英] PDO, 'could not find driver' in laravel 7.20.0
问题描述
我的 Laravel 项目有一个常见问题.当我尝试将 Laravel 与 mysql 数据库连接时,他们说:找不到驱动程序".
I have a common problem in my laravel project.When I try to connect laravel with mysql database they say : "could not find driver".
当我在 cmd 中输入 php -m 来搜索安装的 php 模块时,我找不到 mysql、pgsql 或 sqlite.请,如果您有解决此问题的方法,请回答我,我尝试了很多解决方案.注意:我使用 wampSERVER 3.2.0 和 mysql 3.8.18 和 php 7.4.0
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
推荐答案
点击系统托盘上的WAMPServer图标,然后点击PHP项下的php.ini.接下来找到这一行:
Click WAMPServer icon on system tray then click php.ini under PHP item. next find this lines:
;extension=pdo_mysql
;extension=mysqli
并将它们更改为这些:
extension=pdo_mysql
extension=mysqli
然后在 WampServer 菜单中点击重新启动所有服务
Then click on Restart All Services in WampServer menu
这篇关于Laravel 7.20.0 中的 PDO,“找不到驱动程序"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!