• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue PHP cannot connect to MSSQL after update #53

Cruachan

New Pleskian
I have two servers which can no longer connect to MSSQL after this upgrade. PHP versions 7.1.x, 7.2.x and 7.3.x are all affected. 7.0.x and earlier can still connect fine.

Simple connection script

$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));
}

Results is

Connection could not be established.
Array ( [0] => Array ( [0] => IM004 [SQLSTATE] => IM004 [1] => 0
Code:
 => 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 ) )

I have fallen back to PHP 7.0 in the meantime, where the above script work fine.  It was working fine until Plesk patch #53 was applied yesterday.
 
Can you please specify which OS exactly you have? and which version of MSSQL you are connecting to?
Indeed there were changes in sqlsrv extension in scope of this update.
 
I'm also facing same issue. I have Windows Server 2012 R2 and trying to connect to MSSQL Server 2012.
 
Back
Top