Hopefully this will help someone who is having problems connecting to MSSQL. I was having a heck of a time trying to get my dev server to connect to a remote MSSQL 2005 box.
When using PDO like so:
$mssql = new PDO('dblib:host=<host>;dbname=<dbname>','<user>','<password>');
I was receiving the message:
Adaptive Server is unavailable or does not exist
And mssql_connect() simply told me "Could not connect to server"
I tried everything, different configuration options for FreeTDS/PHP, different versions, etc. But the answer was one line in php.ini:
mssql.secure_connection = Off
This line, which defaults to Off, needs to be ON if you are using NT authentication:
mssql.secure_connection = On
Here is my build:
FreeTDS-0.82 configured like:
./configure --with-tdsver=8.0 --enable-msdblib --with-gnu-ld
PHP 5.2.11 configured like:
./configure --with-mssql=/usr/local --with-pdo-dblib=/usr/local [other options]
Running on Apache/2.2.13 (Unix / Linux)
Feel free to email me if you need help as I've spent 20+ hours reading and fiddling with this issue, so I'm very familiar with it now.