MAMP和Yosemite PDO异常驱动程序问题

时间:2014-10-19 14:54:21

标签: mamp osx-yosemite

我安装了Yosemite,现在当我使用MAMP时,我收到了致命错误:

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

有什么想法吗?

1 个答案:

答案 0 :(得分:3)

以下是解决问题的方法:

  • 启动MAMP
  • 在左上角,转到" MAMP" - > "设定"
  • 转到" PHP"标签
  • 勾选PHP 5.5.17(或任何你拥有的)而不是默认勾选的那个(5.6.1 - > 5.5.17及其最新版本的MAMP)