PDOException not being caught?

后端 未结 2 1583
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 03:10

I\'m getting the following error in PHP:

Fatal error: Uncaught exception \'PDOException\' with message \'SQLSTATE[HY000] [2003] Can\'t connect to MySQL serve         


        
2条回答
  •  执笔经年
    2020-12-07 03:32

    Turn on error_reporting and check the errors.

    ini_set('display_errors', true);
    error_reporting(E_ALL);
    

    May be there is a fatal error, before that line, or maybe PDO is not available.

提交回复
热议问题