将 postgres 与 laravel 连接起来

Far*_*zem 4 php postgresql laravel laravel-5 laravel-5.4

您好,我正在尝试将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
Run Code Online (Sandbox Code Playgroud)

这是我的.env文件

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=Portail
DB_USERNAME=php
DB_PASSWORD=php
Run Code Online (Sandbox Code Playgroud)

这是我的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', ], 
Run Code Online (Sandbox Code Playgroud)

我通常使用 phpPgAdmin

Joh*_*mon 8

须藤 apt-get 安装 php-pgsql。这是在linux下安装php pgsql驱动的命令