cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

Connect in SQL Server database php

Hello

I have a "Hosting - Web - Ultimate - Windows"

My Plesk is running PHP Version 5.6.30

I'm trying to connect in Sql server using sqlsrv_connect or PDO

in both I'm getting an error message


"This extension requires the Microsoft ODBC Driver 11 for SQL Server to communicate with SQL Server"

 

In PDO I use the connection below

$pdo = new PDO('sqlsrv:server=xx;Database=xx', 'xx', 'xx');
------

 

in sqlsrv_connect :
$connectionInfo = array( "Database"=>"xx", "ReturnDatesAsStrings"=> true, "UID"=>"xx", "PWD"=>"xx");        
$data = sqlsrv_connect( $serverName, $connectionInfo);   

--------

If I change my PHP Version to 5.4.45 in Plesk , the code works.

 

 

Any suggestion?

1 REPLY 1
Highlighted
Solution

Re: Connect in SQL Server database php

I tested the PDO connection in php version 7.2.   It works!