title: Connecting to SQL Server using PHP, ODBC, and Windows authentication
body: <p>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 </p>
  
  <pre><code>$link = odbc_connect("my_odbc","",""); 
  </code></pre>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>"Warning: odbc_connect(): SQL error: <br>[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]<br>Login failed for user ''., SQL state 28000 in SQLConnect in C:\Users..."  </p>
  </blockquote>
  
  <p>I tried: </p>
  
  <pre><code>$link = odbc_connect("Driver={ODBC Driver 11 for SQL Server};   
          Server='my_odbc';Integrated Security=SSPI","","");
  </code></pre>
  
  <p>Which returned the message:</p>
  
  <blockquote>
    <p>Warning: odbc_connect(): SQL error: <br>[Microsoft][ODBC Driver 11 for SQL Server]<br>Named Pipes Provider: Could not open a connection to SQL Server [53]. , SQL state 08001 in SQLConnect in C:\Users..."</p>
  </blockquote>
  
  <p>Not sure what I'm doing wrong.  </p>
  
  <ul>
  <li><p><code>my_odbc</code> 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).</p></li>
  <li><p>I am running Windows 7 and using PHP Version 5.6.12</p></li>
  <li><p><code>phpinfo()</code> indicates that ODBC Support is enabled as well as <code>pdo_sqlsrv</code> support</p></li>
  </ul>