【发布时间】:2017-09-24 01:05:43
【问题描述】:
您好我正在尝试连接laravel 5.4 与postgres,更新数据库配置文件并运行php artisan migrate 后,出现以下错误:
[Illuminate\Database\QueryException]
could not find driver (SQL: select * from information_schema.tables where t
able_schema = public and table_name = migrations)
[PDOException]
could not find driver
这是我的.env 文件
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=Portail
DB_USERNAME=php
DB_PASSWORD=php
这是我的database.php 文件
'default' => env('DB_CONNECTION', 'pgsql'),
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'Portail'),
'username' => env('DB_USERNAME', 'php'),
'password' => env('DB_PASSWORD', 'php'),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer', ],
我正常使用phpPgAdmin
【问题讨论】:
-
尝试设置 DB_HOST = localhost 而不是 127.0.0.1
-
也不行
-
你可能没有安装 PHP 模块 pgsql。
-
我通常使用 phpPgAdmin 和 php_pgsql
-
我使用 wampserver 3.0.6 64 位和 php 7
标签: php postgresql laravel laravel-5 laravel-5.4