let me point your attention to this:
http://bugs.mysql.com/bug.php?id=18891
Read the link to the PHP docs. You can enter '127.0.0.1' and TCP connection (and no socket file) is used; if you enter 'localhost' PHP connects through socket.
I don't think this is an issue for SQLyog/SJA to decide where PHP should look for the socket. Don't think it is possible either. This is a system configuration issue on the remote host.