Typically, this means that MySQL isn't running. If it is running, then something's wrong with the socket, and MySQL might need to be shut down and started again. Can you see if the named "socket" file is there?
On my FreeBSD systems, the socket is under /tmp:
[22] Wed 10.Nov.2010 9:12:36
[kadmin@archangel][/usr/local/etc/rc.d] ls -l /tmp/mysql*
srwxrwxrwx 1 mysql wheel 0 Oct 22 20:39 /tmp/mysql.sock=
So it might just be a config issue where PHP is expecting the socket to be somewhere it's not.
Safe bet it's one or the other though: mysql stopped or bad config.