I'm using xampp and I'm trying to connect my PHP project to SQL Server to make reports. But there's a conflict with sqlsrv_connect() function.
My version of PHP installed in XAMPP is 5.6.23 and my connection file contains this:
<?php
$serverName = "MyserverName\MyinstanceName"; //serverName\instanceName
$connectionInfo = array("Database"=>"Database_Example");
$conn = sqlsrv_connect($serverName, $connectionInfo);
if( $conn ) {
echo "Conexión establecida.<br />";
}else{
echo "La conexión no se pudo establecer.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>
Also, I have downloaded the next files and I have extracted in "C:\xampp\php". PHP dll's
And I have added to "php.ini" file this code:
extension=php_sqlsrv_7_ts_x64.dll
extension=php_pdo_sqlsrv_7_ts_x64.dll
I´ve tried too with the exact version of the driver for my PHP and it doesn´t work.
And this is the error that appears when I'm trying to connect:
Call to undefined function sqlsrv_connect() in C:\xampp\htdocs\Inventory\conexion.proc.php