title: PHP/PDO Error: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)
body: <p>I'm running PHP 5.5 on CentOS 6 trying to connect to a MS SQL Server database via PDO. I have searched through about 20 different answers to the same error message and tried every one of them here on SO. When I attempt to connect from PDO I get the following error:</p>
  
  <blockquote>
    <p>SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)</p>
  </blockquote>
  
  <p>I am able to connect through FreeTDS on the command line with <strong>no issue at all</strong>:</p>
  
  <p><code>TDSVER=7.0 tsql -H 192.168.5.57 -p 1433 -U testuser</code></p>
  
  <p>I tried setting <code>tds version = 7.0</code> in <code>freetds.conf</code> and still get the same error.</p>
  
  <p>I've tried connecting to different MS SQL Servers and get the same thing every time. I've tried this same code on a Rackspace Cloud server with no issues. So something between PDO/PHP and FreeTDS doesn't seem to be talking correctly, but I am at a loss of how to track this down.</p>
  
  <pre><code>try {
    $hostname = '192.168.5.57:1433';
    $dbname = 'Test';
    $username = 'testuser';
    $password = 'thisismypassword';
    $db = new PDO("dblib:host=$hostname;dbname=$dbname","$username","$password");
  } catch (PDOException $e) {
    echo 'Failed to get DB handle: ' . $e-&gt;getMessage();
  }
  </code></pre>