Laravel 5.4 Migration Error

独自空忆成欢 提交于 2019-12-06 03:51:44

问题


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.

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 

Any ideas? Im trying to use this.https://github.com/thomastkim/laravel-online-users


回答1:


I would start by determining the exact php modules installed. This can be accomplished by

php -m

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

Your results will be similar to:

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

Install the proper php module for your version. Ex:

sudo apt-get install php7.1-mysql


来源:https://stackoverflow.com/questions/42167523/laravel-5-4-migration-error

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