Laravel 5.4迁移错误 [英] Laravel 5.4 Migration Error
问题描述
我遇到了无法解决的问题.我使用Ubuntu 16.04,PHP 7.1,MySQL和NGINX将应用程序托管在服务器上.我的应用程序运行完美.当我SSH到服务器和应用程序根目录时,我运行以下php artisan session:table,它成功运行.
I am facing a issue that I cannot resolve. I have my app hosted on my server using Ubuntu 16.04, PHP 7.1, MySQL and NGINX. My app works perfect. When I ssh to my server and app root I run the following, php artisan session:table, it runs successfully.
当我运行php artisan migration时,出现foll0wing错误,并且未在数据库中创建表.
When i run php artisan migrate I get foll0wing error and table is not created in my DB.
[Illuminate\Database\QueryException]
could not find driver (SQL: select * from information_schema.tables where t
able_schema = UNIT3D and table_name = migrations)
[PDOException]
could not find driver
有什么想法吗?我正在尝试使用它. https://github.com/thomastkim/laravel-online-users
Any ideas? Im trying to use this.https://github.com/thomastkim/laravel-online-users
推荐答案
我将首先确定安装的确切php模块.可以通过
I would start by determining the exact php modules installed. This can be accomplished by
php -m
查找"phpX.Y-mysql",如果看不到,则未安装php模块. (其中X.Y对应于您的php版本号.
look for 'phpX.Y-mysql', if you do not see it then the php module is NOT installed. (Where X.Y correspond to your php version number.
假设您没有看到它,则可以通过键入以下内容从存储库中找到要安装的确切软件包版本:
Assuming that you do not see it, you can find the exact package version to install from the repos by typing:
sudo apt-cache search php-mysql
您的结果将类似于:
sudo apt-cache search php-mysql
php-mysql - MySQL module for PHP [default]
php7.0-mysql - MySQL module for PHP
php5.6-mysql - MySQL module for PHP
php-mysqlnd-ms - MySQL replication and load balancing module for PHP
php7.1-mysql - MySQL module for PHP
为您的版本安装适当的php模块.例如:
Install the proper php module for your version. Ex:
sudo apt-get install php7.1-mysql
这篇关于Laravel 5.4迁移错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!