我使用Laravel 5时遇到问题.当我运行“php aritsan migrate”时,我收到了这个错误
**************************************
* Application In Production! *
**************************************
Do you really wish to run this command? [y/N] y
[PDOException]
could not find driver
我可以运行应用程序,但是当需要数据库连接时,我收到了这个错误
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文件路径).
查找并取消注释以下行(删除;字符):
;extension=pdo_mysql.so
然后,重新启动Apache服务器.
欲了解更多信息,请read the documentation.
标签:php,laravel,laravel-5,mysql
来源: https://codeday.me/bug/20190917/1808737.html