����JFIF��`�`�����Viewing File: /home/u820193700/domains/spiti2026im.in/public_html/api/diagnostic.php
<?php
// api/diagnostic.php
// Visit this in your browser: https://spiti2026im.in/api/diagnostic.php

header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');

$report = [
    'time' => date('Y-m-d H:i:s'),
    'php_version' => PHP_VERSION,
    'server_software' => $_SERVER['SERVER_SOFTWARE'] ?? 'unknown',
    'db_connection' => 'NOT_TESTED',
    'tables' => []
];

try {
    require_once 'db_connect.php';
    $report['db_connection'] = 'SUCCESS';
    
    $tables = ['admins', 'registrations', 'interests', 'qa', 'hotels', 'contacts', 'gallery'];
    foreach ($tables as $t) {
        try {
            $stmt = $pdo->query("SELECT COUNT(*) FROM $t");
            $report['tables'][$t] = [
                'exists' => true,
                'count' => $stmt->fetchColumn()
            ];
        } catch (Exception $e) {
            $report['tables'][$t] = [
                'exists' => false,
                'error' => $e->getMessage()
            ];
        }
    }
} catch (Exception $e) {
    $report['db_connection'] = 'FAILED';
    $report['db_error'] = $e->getMessage();
}
$report['env'] = [
    'post_max_size' => ini_get('post_max_size'),
    'upload_max_filesize' => ini_get('upload_max_filesize'),
    'display_errors' => ini_get('display_errors'),
    'error_reporting' => ini_get('error_reporting'),
    'mail_enabled' => function_exists('mail'),
    'openssl_enabled' => extension_loaded('openssl')
];

$report['logs'] = [
    'mailer_debug' => []
];

// Check last 5 lines of mailer_debug.log if it exists
$log_file = __DIR__ . '/mailer_debug.log';
if (file_exists($log_file)) {
    $lines = file($log_file);
    $report['logs']['mailer_debug'] = array_slice($lines, -10);
} else {
    $report['logs']['mailer_debug'] = "Log file not found at $log_file";
}

echo json_encode($report, JSON_PRETTY_PRINT);
Back to Directory �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������ ��?��_��+��?��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����