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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.