Laravel Illuminate \ Database \ QueryException:找不到驱动程序错误

问题描述 投票:0回答:1

我在PHP 7.2中使用Centos 7.7,但是当我尝试使用laravel迁移数据库时,会发生此错误。尝试了很多事情,但我无法解决。

Illuminate\Database\QueryException  : could not find driver (SQL: select * from information_schema.tables where table_schema = forge and table_name = migrations and table_type = 'BASE TABLE')

  at /var/www/vhosts/xxxx.com/saas.xxxx.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
  > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673|
php laravel centos plesk
1个回答
0
投票

您需要安装驱动程序试试这个

yum install -y --enablerepo=remi-php72 php-pdo_mysql

也有帮助https://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-install-php-7-3-7-2-7-1-on-centos-7-rhel-7-centos-6-rhel-6.html

© www.soinside.com 2019 - 2024. All rights reserved.