could not find driver in laravel

半世苍凉 提交于 2019-12-11 14:18:37

问题


As I run php artisan migrate command it output

In Connection.php line 664:
could not find driver (SQL: select * from information_schema.tables where t able_schema = employee and table_name = migrations)
In PDOConnection.php line 47: could not find driver In PDOConnection.php line 43: could not find driver

and also i have pdo enabled for mysql, pgsql, sqlite im using ubuntu 16 and PHP Version 7.2.8 and laravel 5.5


回答1:


Use php -m command to check whether mysql, pgsql, sqlite modules are installed.

If not listed then use following command to install.

apt-get install php7.2-mysql php7.2-pgsql php7.2-sqlite



回答2:


Try unninstalling the PDO and installing it again using:

$ apt-get install php-mysql

When you install it, it should already register and enable it's own dependencies.

You can test if it's enabled creating a file with this content:

<?php phpinfo(); ?> 

In the indexed/public folder of your server.




回答3:


try to install php-mysql with following command sudo apt-get install php-mysql and restart your server



来源:https://stackoverflow.com/questions/51982770/could-not-find-driver-in-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!