2
votes

I know this question have been asked a thousand of times, but I can't find a solution. I'm running Symfony 2 with a PostgreSql database (php running in MAMP, and PG DB on an another port and install).

I was running well (could have install the DB using the app/console create cmd) however now I can't use it anymore for updating the schema. Got the error :

PDO Exception, could not find driver error

I tried everything:

  • Php.ini verification : OK
  • using the same in the CLI and phpInfo();
  • PDO verification in phpInfo : drivers enabled for pgSQL mySQL etc...
  • Restart Mamp + OSX apache server : OK
1
CLI and Apache SAPI are two distinct binaries and config files. - mario
Can you post the output of var_dump(pdo_drivers()); ? - hek2mgl
The php.ini you edit might not be the one actually read by the server. Create a phpinfo() page to state the one used by your PHP installation. - greg
var_dump(pdo_drivers()) : array(3) { [0]=> string(6) "sqlite" [1]=> string(5) "pgsql" [2]=> string(5) "mysql" } Looks like the config used by the apache contains pgsql... - Alex Pereira

1 Answers

2
votes

Found a solution, I just made an alias in my .bash_profile to the php used by the server to be sure that the CLI will use the good one.

Alias PHP -> Mamp CLI

alias phpmamp='/Applications/MAMP/bin/php/php5.4.4/bin/php'

Now it works.