连接到SQL Server数据库时出错

I'm having an error connecting to my database on another server since PHP.

Install the extension to connect, in my phpinfo() I can see it.

enter image description here

In my php code I execute the following:

if( sqlsrv_configure("WarningsReturnAsErrors", 0) === false)  
{  
    DisplayErrors();  
    die;  
}  else {
    echo sqlsrv_configure("WarningsReturnAsErrors", 0);
}

And what returns is a "1"

However, if I run:

$serverName = "MY.IP,1433";
$database = "my_database";
$uid = 'usr';
$pwd = '12345';
try {
    $conn = new PDO(
        "sqlsrv:server=$serverName;Database=$database",
        $uid,
        $pwd,
        array(
            //PDO::ATTR_PERSISTENT => true,
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
        )
    );
}
catch(PDOException $e) {
    die("Error connecting to SQL Server: " . $e->getMessage());
}

I receive the error

could not find driver