I\'m getting the following error in PHP:
Fatal error: Uncaught exception \'PDOException\' with message \'SQLSTATE[HY000] [2003] Can\'t connect to MySQL serve
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.
The only thing I can think of is if you're inside a namespaced class, and should use \PDOException
instead of PDOException
.