I've been through something similar before but I can't remember what fixes it. If I run the following code:
$dsn = "MyDSN";
$user = "user";
$pass = "pass";
$fflink = odbc_connect($dsn, $user, $pass);
if($fflink)
{
echo "Connected!\n";
}
else
{
echo "Can't connect to server: ".odbc_error()." -- ".odbc_errormsg()."\n";
}
Via the Linux console, I get this:
Connected!
Via the web page, I get this:
Can't connect to server: IM002 -- [unixODBC][Driver Manager]Data source name not found, and no default driver specified
If I run "isql -v MyDSN user pass" from the console I can connect and run queries.
It appears to me that Apache is pointing PHP to the wrong driver (messages should be coming from be from [unixODBC][FreeTDS][SQL Server], not [unixODBC][Driver Manager]), but I don't know how to change it and Google hasn't been much help. There doesn't seem to be an option for it in php.ini and I didn't see anything in httpd.conf.
Can anyone point me in the right direction?