I have installed FreeTDS on my Mac, but I'm having some issues connecting using
$connect = mssql_connect('IP_ADDRESS', 'username', 'password');
$connect = mssql_connect('DSN_NAME', 'username', 'password');
unable to connect to server: DSN_NAME
When I installed FreeTDS I originally used MacPorts. I believe that this gave me some conflicts for where freetds.conf should have been. And even though the path for freetds.conf when running
tsql -C was the actual path that I was attempting to use, when I compiled the mssql.so extension with that path PHP wouldn't recognize it.
The solution is to forget MacPorts for FreeTDS and just install FreeTDS from source. Then install the mssql.so extension from the PHP source and make sure you're using the same version that is on your system (mine was 5.3.13 under OS X Mountain Lion).
If you follow the instructions at this blog exactly you shouldn't have any issues.
A couple of final things:
sudo port uninstall freetds +odbcand then
sudo port uninstall unixODBC. Make sure you uninstall all instances of FreeTDS. If you have more than one, you'll get a notice when you run uninstall that you need to specify the version to uninstall.