Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAMP and Yosemite PDO Exception Driver Issue

I installed Yosemite and now when I use MAMP I receive this Fatal error:

Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in 
/Applications/MAMP/htdocs/CRUD/pdo.php:3 Stack trace: #0     
/Applications/MAMP/htdocs/CRUD/pdo.php(3): PDO->__construct('mysql:host=loca...', 'fred', 
'zap') #1 /Applications/MAMP/htdocs/CRUD/index.php(2): require_once('/Applications/M...') 
#2 {main} thrown in /Applications/MAMP/htdocs/CRUD/pdo.php on line 3

Any ideas?

like image 959
Elana Avatar asked Dec 18 '25 19:12

Elana


1 Answers

Here is a way to fix it:

  • Start MAMP
  • On the top left, go to "MAMP" -> "Preferences"
  • Go to the "PHP" tab
  • Tick PHP 5.5.17 (or whatever you have) instead of the one which is ticked by default (5.6.1 -> 5.5.17 with he latest version of MAMP)
like image 120
l3aronsansgland Avatar answered Dec 21 '25 16:12

l3aronsansgland



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!