title: PHP unable to connect to SQL Server using PDO- exception
body: <p>Im trying to connect php to SQL server driver using below:</p>
  
  <p>It works fine for MYSQL., but not for SQL Server.</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  ini_set('display_errors', 1);
  $data = json_decode(file_get_contents('php://input'), true);
  
  if(!empty($data)):
  header('Content-Type:text/plain');
  $hostname = '10.8.8.9';                 
  $username = 'siddharth';
  $password = '1234';
  $dbname = 'AirportFootfall';
  $mssqldriver = '{SQL Server}';
  //$dbh = new PDO("mssql:host=$hostname;dbname=AirportFootfall", $username, $password);
  //$dbh =  new PDO("sqlsrv:Server=10.16.34.90;Database=AirportFootfall", $username, $password);
  //$dbh =    new PDO("odbc:Driver=$mssqldriver;Server=$hostname;Database=AirportFootfall", $username, $password);
  //$dbh = new PDO("odbc:Driver=$mssqldriver;Server=$hostname;Database=AirportFootfall", $username, $password);
  //$dbh = new PDO("dblib:host=$hostname;dbname=AirportFootfall", $username, $password);
  //$dbh = new PDO("dblib:host=$hostname;dbname=$dbname", $username, $password);
  $dbh = new PDO("dblib:host=$hostname;dbname=$dbname", $username, $password);
  $arraykey=array_keys($data); 
  $array=$data[$arraykey[0]]; 
  
  try 
  {
  
      $count = $dbh-&gt;exec('INSERT INTO RadioCon_Sensor_Raw_Data(version,visitorId,dwellTime,poiId,srId,zoneId,poiProximityConfidence,zoneProximityConfidence,poiPresenceConfidence,zonePresenceConfidence,normalizedTime) VALUES ("' . implode('", "', $array) . '")' ) or die(print_r($dbh-&gt;errorInfo(), true)); 
   //echo $count;
  $dbh = null;
  echo 'Data Successfully inserted!!&lt;br /&gt;';
  }
  catch(PDOException $e)
  {
      echo $e-&gt;getMessage();
  }
  
  endif;
  ?&gt;
  </code></pre>
  
  <p>UPDATE: Have insatalled the pdo_dblib extension.</p>
  
  <p>Im getting </p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /var/www/html/RADIOLOCOUS/GMR/gmrsample_copy.php:14 Stack trace: #0  PDO->__construct('odbc:Driver={SQ...', 'siddharth', '1234') #1 {main} thrown in ....line 14</p>
  </blockquote>
  
  <p>Any alternate way to connect apart from pdo</p>
  
  <p>Im using Ubuntu 14.04 LAMP with php 5.5</p>
  
  <p>My php_info says:</p>
  
  <blockquote>
    <p>PDO drivers    dblib, mysql </p>
  </blockquote>