I trying to connect to a MSSQL Server with PHP. For that I am using the following script:
function mssqli_connect($server,$username,$password,$database){
$connectionInfo = array("Database"=>$database, "UID"=>$username, "PWD"=>$password);
return sqlsrv_connect($server,$connectionInfo);
}
I am running PHP 7.0.7 on a Windows Server with the IIS 7.5. Unfortunately it doesn't work and I have no idea why.
What I've already tried
I dumped the function, but it only returns bool(false)
, which is not very helpful. I also tried to ping the server via cmd. This has succeeded. The credentials are also correct.
The extension php_sqlsrv_7_nts.dll
is also requested in the php.ini
, so it doesn't give me an error, that the function wasn't found.
Do I miss something, which is required?