query('SELECT 1'); echo json_encode([ 'status' => 'ok', 'time' => gmdate('c'), 'php' => PHP_VERSION, 'database' => 'connected', ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); } catch (Throwable $exception) { http_response_code(500); echo json_encode([ 'status' => 'error', 'time' => gmdate('c'), 'message' => 'health-check failed', ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); }