I want to build Laravel + PostgreSQL existing Project.
config.php
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL', "pgsql://postgres:123@127.0.0.1:5432/crawler"),
'host' => env('DB_POSTGRES_HOST', '127.0.0.1'),
'port' => env('DB_POSTGRES_PORT', '5432'),
'database' => env('DB_POSTGRES_DATABASE', 'crawler'),
'username' => env('DB_POSTGRES_USERNAME', 'postgres'),
'password' => env('DB_POSTGRES_PASSWORD', '123'),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer'
],
I tried to migrate the database.
But error occured.
Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')
at E:\Task\cookie.crawler.backend.api\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|
Exception trace:
1 Doctrine\DBAL\Driver\PDO\Exception::("could not find driver")
E:\Task\cookie.crawler.backend.api\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO\Exception.php:18
2 Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
E:\Task\cookie.crawler.backend.api\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:44
Please use the argument -v to see more details.
What's the reason.
I've installed PostgreSQL recently and not familiar with this.