找不到驱动程序pdo_pgsql symfony 2.8

I made a lot of search and didn't find any solution. Whenever I try to php app/console doctrine:database:create, SF2 returns me an error "could not find driver".

I went in /app/config.php and configured my php.ini correctly. Extensions are uncommented and enabled.

php -m tells me pgsql is activated. phpinfo(); too, and also tells me the path of the bin which's used. (which is the one noticed on /web/config.php).

I tried all I could, but i can't create a database.

Any help would be appreciated.

doctrine:
dbal:
    driver:   pdo_pgsql
    host:     "%database_host%"
    port:     "%database_port%"
    dbname:   "%database_name%"
    user:     "%database_user%"
    password: "%database_password%"
    charset:  UTF8


extension=pgsql.so
extension=pdo_pgsql.so (in php.ini)

I don't know ...

I found a solution, my SF2 project was using a wrong php bin (wrong path). My web server's correctly running with php 7 but my CLI's using php 5 bin. Simply create a script in your ~/.bashrc_profile (mac user) and copy/paste this into it : `

export PATH=/usr/local/php5/bin:$PATH 

(if you installed php 7 on your mac and his bin is located in /usr/local/php5).

If you're using MAMP as webserver, copy paste this :

export PATH=/Applications/MAMP/bin/php/php7.0.0/bin:$PATH

Then you can tip

php app/console doctrine:database:create

And enjoy !

Install Postgresql:

apt-get install postgresql postgresql-client
apt-get install php7.0-pgsql // or 5.5.9 your version

In /etc/php5/apache2/php.ini, add or check: (this is in fact optional)

extension=pdo.so
extension=php_pdo_pgsql.so