I'm trying to use PHP to connect to an ODBC data source using Windows authentication. I can connect just fine to the server in SQL Server so I know it's running. When I try to run the command
$link = odbc_connect("my_odbc","","");
I get the error:
"Warning: odbc_connect(): SQL error:
[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]
Login failed for user ''., SQL state 28000 in SQLConnect in C:\Users..."
I tried:
$link = odbc_connect("Driver={ODBC Driver 11 for SQL Server};
Server='my_odbc';Integrated Security=SSPI","","");
Which returned the message:
Warning: odbc_connect(): SQL error:
[Microsoft][ODBC Driver 11 for SQL Server]
Named Pipes Provider: Could not open a connection to SQL Server [53]. , SQL state 08001 in SQLConnect in C:\Users..."
Not sure what I'm doing wrong.
my_odbc
is a SQL Server (2008) on a different machine. I don't have admin privileges on that database so I can't change anything on that end (such as enabling SQL Server authentication).I am running Windows 7 and using PHP Version 5.6.12
phpinfo()
indicates that ODBC Support is enabled as well aspdo_sqlsrv
support