Most of the times you will see something like this (actually the error message varies a bit, but…)
[unixODBC][FreeTDS][SQL Server]Unable to connect to data source.
What happens is that your data source configuration is either wrong or in the wrong place (yours trully).
To help you troubleshoot the error that you are getting, check the following configurations:
Update: Make sure that you are editing the correct freetds.conf file. For that you can use tsql -C that will show you all variables that are enabled in compile time, including the location of the freetds.conf.
These 3 configurations together will construct your data source and when PHP with unixODBC and PDO-DBLIB tries to connect it will run all of those configurations to construct the connection. If you have a wrong configuration you will have that error.
Another thing that you can troubleshoot is checking the FreeTDS configuration in compile time ( tsql -C ). Check if all configuration is as it should. My issue was related to this. One of the configurations that I was missing was to enable freetds to work with msdblib module.
Other thing is to check if you have installed the unixODBC-dev package (source). When you install FreeTDS with unixODBC it will look for a sql.h library. This library is part of the unixODBC-dev package. Install it and it should be good to go.
I’m using Xubuntu 8.10 and 99% of the things that I have installed to make this work where done by the Symatic Package installer.
Hope it helps you as much as it did help me and if you have any questions, post it here and I will try to help you out as much as I can.