I woork on my local site with MAMP. Everything was going right till yesterday. Now, when I run my code, I get a : "Fatal error: Uncaught exception 'PDOException' with message 'could not find driver'..." It seems that I have non installed driver but it worked well until this day. How can I fix this problem ?
Best,
Newben
I had a similar problem. Sfblaauw's solution didn't work but it helped me identify the problem. First I installed php5-mysql using MacPorts:
sudo port install php5-mysql
During installation, I got the following warning:
Your php.ini contains a line that will prevent php5-mysql
and other PHP extensions from working. To fix this,
edit /opt/local/etc/php5/php.ini and delete this line:
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20090626"
I commented out the line and restarted Apache. Everything seems to work fine now.
Have you installed MacPorts? If your answer is "yes" open your Shell and type:
cd ~/
sudo nano .profile
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
close your Shell and re-open it
This is all. I found the solution here: thewebfactory