PDO Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Fatal error: Call to a member function prepare() on null in /var/www/html/events/model/Entry.php on line 120