that looks like a problem with your PHP MySQL config.
Can you connect to your MySQL Server with e.g. PHPmyAdmin?
Best regards,
schmunk
If I do something like
$ php -i | grep SOCKET
I get
$ php -i | grep SOCKET
MYSQL_SOCKET => /opt/local/var/run/mysql5/mysqld.sock
MYSQLI_SOCKET => /opt/local/var/run/mysql5/mysqld.sock
Take a look if your socket file exists there.
Note that these values may differ between Apache and CLI.