Periodic "Cannot connect to database"

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Periodic "Cannot connect to database"

Postby shorepatrol » 15. February 2021 17:59

Hi All,

I am using XAMP with PHP hitting a Microsoft SQL database. I've installed the sql_srv drivers, etc - and everything works great!

I am closing the connection after each webpage runs as a best practice.

However, every once in a while the database connection fails, and can only work again when XAMP is completely restarted.

Where do I begin to troubleshoot this?
shorepatrol
 
Posts: 2
Joined: 03. February 2021 21:45
XAMPP version: 3.2.4
Operating System: Windows Server 2012 R2

Re: Periodic "Cannot connect to database"

Postby shorepatrol » 15. February 2021 20:03

MORE INFORMATION:
This is the actual PHP error received:
Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 21 [code] => 21 [2] => [Microsoft][ODBC Driver 17 for SQL Server]Encryption not supported on the client. [message] => [Microsoft][ODBC Driver 17 for SQL Server]Encryption not supported on the client. ) [1] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 21 [code] => 21 [2] => [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection [message] => [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [message] => [Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) )

Not sure how it can "lose" the instance name randomly, as the instance name is stored in a session variable.
shorepatrol
 
Posts: 2
Joined: 03. February 2021 21:45
XAMPP version: 3.2.4
Operating System: Windows Server 2012 R2


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 66 guests