gpt4 book ai didi

php - Laravel 照亮\数据库\查询异常 : could not find driver Error

转载 作者:行者123 更新时间:2023-12-04 19:41:36 26 4
gpt4 key购买 nike

我将 Centos 7.7 与 PHP 7.2 一起使用,但是当我尝试使用 laravel 迁移 db 时会发生此错误。尝试了很多东西,但我无法解决这个问题。

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|

最佳答案

你需要安装驱动
尝试这个

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

关于php - Laravel 照亮\数据库\查询异常 : could not find driver Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59206966/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com