我安装了 laragon 5.0,并启用了 postgresql 14,但是,当我运行命令“php artisan migrate”时,我收到此错误:
Dropping all tables .............................................................................................................. 12ms FAIL
Illuminate\Database\QueryException
could not find driver (Connection: pgsql, SQL: select tablename, concat('"', schemaname, '"."', tablename, '"') as qualifiedname from pg_catalog.pg_tables where schemaname in ('public'))
at vendor\laravel\framework\src\Illuminate\Database\Connection.php:801
797▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
798▕ );
799▕ }
800▕
➜ 801▕ throw new QueryException(
802▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
803▕ );
804▕ }
805▕ }
1 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65
PDOException::("could not find driver")
2 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65
PDO::__construct("pgsql:host=127.0.0.1;dbname='sistema_ordenes_servicio';port=5432;sslmode=prefer", "postgres", Object(SensitiveParameterValue), [])
我将非常感谢任何帮助!
我尝试解释我的问题并解决它
该错误表明您的 Laravel 环境中未正确安装或配置 PostgreSQL 驱动程序。确保您已在 PHP 配置中安装并启用了 PostgreSQL 驱动程序。您可能需要安装
pdo_pgsql
扩展。