How to install sqlsrv driver in pdo?

0

How do I install or sqlsrv driver in pdo?

<?php
function conectar(){

$pdo = null;
try {
    $opcoes = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
    $pdo = new PDO("sqlsrv:server;host=192.168.0.30\COMPASS;dbname=weset;", "sa","Cabilog2015@", $opcoes);
} catch (Exception $e) {
    echo $e->getMessage();
}
return $pdo;
}

conectar();
?>

I'm getting this message in the browser:

  

could not find driver

    
asked by anonymous 22.02.2017 / 21:01

0 answers