The reason you must not use /tmp/mysql.sock is that any Tom, Dick or Other can simply delete it and bring your php-mysql system down.
The fix is actually simple:
sudo mkdir -p /var/mysql
sudo chgrp mysql /var/mysql
sudo chmog g+w /var/mysql
edit/create /private/etc/my.cnf and add the line:
now the new php wil find the socket info in the right place, if you change php then you might need to tell that about the new secure location.