1

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
2
  • Do you find an entry for pqsql in your phpinfo() output? Commented Aug 20, 2013 at 17:11
  • yea I do find both pdo_pgsql and pgsql Commented Aug 20, 2013 at 22:42

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

I had the same problem, I solved it by installing php-pgsql

1 Comment

Which Driver you have Selected while installing.?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.