Reputation: 68
I want to create a project using symfony2 with postgresql, but when I run the command: php app/console doctrine:database:create I got the error: Could create database named "test", could not find driver, I know It has something with drivers but I made sure wampserver load php_pdo_pgsql, this is my parameters.yml file:
database_driver: pdo_pgsql
database_host: 127.0.0.1
database_port: 5432
database_name: test
database_user: postgres
database_password: openpgpwd
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: eb10e110d2a3c3f3f5df66181eb10376109f
database_path: null
Upvotes: 1
Views: 4302
Reputation: 2541
Try this. Tested on Symfony 2.7. In parameters.yml the database_driver does not work. To make postgre work with Symfony, in config.yml find
doctrine:
dbal:
driver: pdo_mysql
And change it to
doctrine:
dbal:
driver: pdo_pgsql
That should do the trick. You can get rid of database_driver in parameters.yml or use it as you change pdo_mysql to %database_driver% . There is no need to tell that the php postgresql module is necessary.
Upvotes: 2