Laravel 5 PDOException找不到驱动程序 [英] Laravel 5 PDOException Could Not Find Driver
本文介绍了Laravel 5 PDOException找不到驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Laravel 5时遇到问题.当我运行"php aritsan migration"时,出现此错误
I have a problem using Laravel 5. When I run "php aritsan migrate", I got this error
**************************************
* Application In Production! *
**************************************
Do you really wish to run this command? [y/N] y
[PDOException]
could not find driver
我可以运行该应用程序,但是当需要数据库连接时,出现此错误
I could run the application, but when database connection needed, I got this error
PDOException in Connector.php line 55:
could not find driver
in Connector.php line 55
at PDO->__construct('mysql:host=localhost;dbname=mydb', 'root', '', array('0', '2', '0', false, false)) in Connector.php line 55
at Connector->createConnection('mysql:host=localhost;dbname=mydb', array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'mydb', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 22
如何解决?
推荐答案
您应在服务器上安装PDO.
编辑您的php.ini(查看您的phpinfo()
已加载的配置文件"行,以找到php.ini文件路径).
查找并取消注释以下行(删除;
字符):
You should install PDO on your server.
Edit your php.ini (look at your phpinfo()
, "Loaded Configuration File" line, to find the php.ini file path).
Find and uncomment the following line (remove the ;
character):
;extension=pdo_mysql.so
然后,重新启动Apache服务器. 有关更多信息,请阅读文档.
Then, restart your Apache server. For more information, please read the documentation.
这篇关于Laravel 5 PDOException找不到驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文