I have a couple of servers running WISP stacks on Windows 2016 server using Plesk 17 when update #53 was applied. Up until last night all were functioning perfectly. Both servers are fully updated with critical windows patches, one with all patches. Both are now failing to connect to SQL Server with any version of PHP later than and including 7.1.x.
Standard connect code - such as (for test purposes)
$serverName = "myserver";
$uid = "myuid";
$pwd = "mypassw";
$databaseName = "mydb";
$connectionInfo = array("UID"=>$uid,"PWD"=>$pwd,"Database"=>$databaseName);
$conn = sqlsrv_connect($servername, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
} else{
echo "Connection could not be established.<br />";
die( print_r(sqlsrv_errors(), true));
}
Which was running perfectly and continues to do so on PHP 7.0.x now fails with
Connection could not be established. Array ( [0] => Array ( [0] => IM004 [SQLSTATE] => IM004 [1] => 0 [2] => [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed [message] => [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed ) )
Where should I be looking to fix?
According to symptoms, installation of the component "Microsoft ODBC Driver 17 for SQL Server" is corrupted. To reinstall it, use the following steps:
C:\ParallelsInstaller\parallels\MSODBCSQL-WIN\thirdparty-windows\msodbcsql_17.3.1.1_x64.msi
. The version in the filename may vary slightly depending on the Plesk version.Next
, Choose Repair
and click Next
again.