• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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