0

Using PHP 7.1.33, I was creating a new database for my project and this problem appeared to me

php bin/console doctrine:database:create
In AbstractPostgreSQLDriver.php line 79:
  An exception occurred in driver: could not find driver

In PDOConnection.php line 31:
  could not find driver

In PDOConnection.php line 27:
  could not find driver

doctrine:database:create [-s|--shard SHARD] [-c|--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--]

greybeard
  • 2,249
  • 8
  • 30
  • 66

1 Answers1

0

You need php pdo_pgsql extension.

Linux:

wget -c https://www.php.net/distributions/php-7.1.33.tar.gz
tar -xf php-7.1.33.tar.gz
cd php-7.1.33/ext/pdo_pgsql
phpize
./configure
make
make install

vi php.ini
extension=pdo_pgsql.so

Windows:

# Edit php.ini
extension=pdo_pgsql.dll
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 28 '21 at 09:11