title: PHP Connection to MS SQLServer 2008 from Linux via PDO
body: <p>I need to connect to a MS SQLServer 2008 service from PHP on Ubuntu, and I would like to do so using PDO. I believe I have installed all the prerequisite libraries, and I am indeed able to connect using <code>tsql</code> on the command line and using <code>mssql_connect()</code> in code. I can't figure out what the proper DSN is, or if there are any additional PDO-specific configuration steps I am missing.</p>
  
  <p>I am using the following DSN (where <code>$db*</code> variables are populated with their appropriate values):</p>
  
  <pre><code>odbc:Driver=FreeTDS;SERVER=$dbServer;DATABASE=$dbSchema;UID=$dbUser;PWD=$dbPasswd"
  </code></pre>
  
  <p>My error message is:</p>
  
  <pre><code>PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[IM002] SQLDriverConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified' in /home/timothy/test.php:4
  Stack trace:
  #0 /home/timothy/test.php(4): PDO-&gt;__construct('odbc:Driver=Fre...')
  #1 {main}
    thrown in /home/timothy/test.php on line 4
  </code></pre>
  
  <p>What additional configuration steps have I over looked?</p>
  
  <p>Thanks in advance.</p>