我正在使用:
- 菲律宾比索 7.2 拉
- 拉维尔 5.8
- 乌班图19
PHP Artisan 迁移抛出此错误:
**IlluminateDatabaseQueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = laraveldb and table_name = migrations and table_type = 'BASE TABLE')**
1. PDOException::("could not find driver")
/home/amar/sandbox/l5/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
2. PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=laravel", "root", "localhost", [])
/home/amar/sandbox/l5/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
在php.ini
文件中添加extension=pdo_mysql.so
,并确保在对php.ini
文件进行更改后重新启动server
,否则更改可能不会反映。您也可以在此链接中检查许多方法 - 点击这里
- 删除供应商文件夹并使用作曲家安装重新安装它
- 更新/安装您的 PHP 扩展(php-mysql、php-mbstring、php-pdo、php-dom(
以上两个步骤解决了我的问题。