I have updated XAMP to the latest version, which comes with php 7.2.
I have added the drivers to xamp / php / ext /:
php_pdo_sqlsrv_72_nts.dll
php_pdo_sqlsrv_72_nts.dll
php_sqlsrv_72_ts.dll
php_sqlsrv_72_ts.dll
I have also configured the php.ini:
extension=php_pdo_sqlsrv_72_nts_x86
extension=php_sqlsrv_72_nts_x86
extension=php_pdo_sqlsrv_72_ts_x86
extension=php_sqlsrv_72_ts_x86
Here my connection code to SQL SERVER:
<?php
$serverName = "NOWAY\SQLEXPRESS"; //serverName\instanceName
$connectionInfo = array( "Database"=>"a1", "UID"=>"root", "PWD"=>"NOWAY");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Conexión establecida.<br/>";
}else{
echo "Conexión no se pudo establecer.<br/>";
die( print_r( sqlsrv_errors(), true));
}
}
Finally I have this error:
Connection could not be established. Array ([0] = > Array ([0] => IMSSP [SQLSTATE] = > IMSSP 1 = > -49 [code] = > -49 [2] = > This extension Requires the Microsoft ODBC Driver for SQL Server. Access the Next URL to download the ODBC Driver for SQL Server for x86: link [message] = > Este extension requires the Microsoft ODBC Driver for SQL Server. Access the following URL to download the ODBC Driver for SQL Server for x86: link ) 1 = > Array ([0] = > IM002 [SQLSTATE] = > IM002 1 = > 0 [code] = > 0 [2] = > [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified [message] = > [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified))
I have also verified if I have installed the ODBC driver in windows
As you can see, I have attacked the situation in several ways and I still can not find the solution. How could I solve this error?