Symfony 2 PDOException Could Not Find Driver – with MAMP 2.0
26 Oct 2011 2 Comments

In case you got the mentioned PDOException you probably didn’t use the correct PHP (most likely you used the system’s PHP instead of MAMP’s).
I ran into the exception while trying to create a scheme with doctrine on my Macbook Pro running Snow Leopard:
> php app/console doctrine:schema:create

Solution:
The Solution is quite easy. We are going to create a permanent alias for the MAMP PHP by making an entry to the ~/.bash_profile.
Run the following command:
> sudo nano ~/.bash_profile
Now add this line (you can change the alias though) and save with [Ctrl]+[O]:
alias php2='/Applications/MAMP/bin/php5.3/bin/php'
After a terminal-restart you should be able to use MAMP’s PHP by typing php2.
Feb 04, 2012 @ 01:36:10
I had the same problem with my MAMP 2.0.5 and Mac 10.6.8
Everything was installed correctly, the issue was that in CLI php is calling different php file.
You should edit .profile file.
open .profile and change:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
replace with:
export PATH=/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php/php5.3.6/bin/:$PATH
With my machine the issue was that I had installed MacPorts and that programme was added that PATH in my .profile file.
That took me 1 day to find out what was the issue.
Feb 04, 2012 @ 15:15:27
Thanks for your reply – I’m going to check your suggestion as fast as I can!