You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
642 B
25 lines
642 B
<?php |
|
|
|
header('Content-Type: text/plain; charset=utf-8'); |
|
http_response_code(503); |
|
|
|
$serverName = getenv('MSSQL_HOST') ?: '10.100.1.25'; |
|
$connectionOptions = [ |
|
'Database' => getenv('MSSQL_DATABASE') ?: 'master', |
|
'Uid' => getenv('MSSQL_USER') ?: 'sa', |
|
'PWD' => getenv('MSSQL_PASSWORD') ?: '', |
|
'Encrypt' => true, |
|
'TrustServerCertificate' => false, |
|
]; |
|
|
|
$conn = sqlsrv_connect($serverName, $connectionOptions); |
|
|
|
if ($conn) { |
|
http_response_code(200); |
|
echo 'OK [NTS] SQL Server reachable (Encrypt=true, TrustServerCertificate=false)'; |
|
sqlsrv_close($conn); |
|
exit; |
|
} |
|
|
|
echo "FAIL [NTS]\n"; |
|
print_r(sqlsrv_errors());
|
|
|