Версия php 5.6
extension=php_pdo_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_ts.dll
В php.ini добавил, файлы закинул.
Запустил тестовый вариант от Microsoft
$serverName = "SRV-askut\wincc";
$connectionInfo = array("UID" => "Winccdblink", "PWD" => "12345");
$conn = sqlsrv_connect($serverName, $connectionInfo);
if( $conn )
{
echo "Connection established.\n";
}
else
{
echo "Connection could not be established.\n";
die( print_r( sqlsrv_errors(), true));
}
И получил ошибку
ОшибкаConnection could not be established. Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][��������� ��������� ODBC] �������� ������ �� ������ � �� ������ �������, ������������ �� ��������� [message] => [Microsoft][��������� ��������� ODBC] �������� ������ �� ������ � �� ������ �������, ������������ �� ��������� ) )
Пробую Конект через PDO
$conn = new PDO("sqlsrv:Server=SRV-askut\wincc;", "Winccdblink", "12345");
Ошибка2Uncaught exception 'PDOException' with message 'SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver 11 for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712' in C:\OSPanel\domains\serveraplic\index.php:7 Stack trace: #0 C:\OSPanel\domains\serveraplic\index.php(7): PDO->__construct('sqlsrv:Server=S...', 'Winccdblink', '12345') #1 {main} thrown in C:\OSPanel\domains\serveraplic\index.php on line 7
Хотя в документации сказано что ODBC юзать не нужно. Что я делаю не так?