|
| 1 | +<?php |
| 2 | +// Diagnostic script to help troubleshoot white screen |
| 3 | +error_reporting(E_ALL); |
| 4 | +ini_set('display_errors', 1); |
| 5 | +ini_set('log_errors', 1); |
| 6 | + |
| 7 | +echo "<!DOCTYPE html><html><head><title>Diagnostic</title></head><body>"; |
| 8 | +echo "<h1>Diagnostic Report</h1>"; |
| 9 | +echo "<pre>"; |
| 10 | + |
| 11 | +// PHP Version |
| 12 | +echo "PHP Version: " . phpversion() . "\n"; |
| 13 | +echo "Server: " . $_SERVER['SERVER_SOFTWARE'] . "\n\n"; |
| 14 | + |
| 15 | +// Memory |
| 16 | +echo "Memory Limit: " . ini_get('memory_limit') . "\n"; |
| 17 | +echo "Max Execution Time: " . ini_get('max_execution_time') . "s\n\n"; |
| 18 | + |
| 19 | +// Extensions |
| 20 | +echo "MySQLi Extension: " . (extension_loaded('mysqli') ? 'YES' : 'NO') . "\n\n"; |
| 21 | + |
| 22 | +// Test config.php |
| 23 | +echo "Testing config.php...\n"; |
| 24 | +if (file_exists('config.php')) { |
| 25 | + echo "✓ config.php exists\n"; |
| 26 | + try { |
| 27 | + require_once 'config.php'; |
| 28 | + echo "✓ config.php loaded successfully\n"; |
| 29 | + |
| 30 | + if (isset($conn)) { |
| 31 | + echo "✓ \$conn variable exists\n"; |
| 32 | + |
| 33 | + if ($conn->connect_error) { |
| 34 | + echo "✗ Database connection error: " . $conn->connect_error . "\n"; |
| 35 | + } else { |
| 36 | + echo "✓ Database connected successfully\n"; |
| 37 | + |
| 38 | + // Test query |
| 39 | + $result = $conn->query("SELECT COUNT(*) as count FROM codes"); |
| 40 | + if ($result) { |
| 41 | + $row = $result->fetch_assoc(); |
| 42 | + echo "✓ Codes table accessible - " . $row['count'] . " codes found\n"; |
| 43 | + } else { |
| 44 | + echo "✗ Query failed: " . $conn->error . "\n"; |
| 45 | + } |
| 46 | + } |
| 47 | + } else { |
| 48 | + echo "✗ \$conn variable not set in config.php\n"; |
| 49 | + } |
| 50 | + } catch (Exception $e) { |
| 51 | + echo "✗ Error loading config.php: " . $e->getMessage() . "\n"; |
| 52 | + } |
| 53 | +} else { |
| 54 | + echo "✗ config.php not found\n"; |
| 55 | +} |
| 56 | + |
| 57 | +echo "\n--- File Checks ---\n"; |
| 58 | +echo "logo.png exists: " . (file_exists('logo.png') ? 'YES (' . filesize('logo.png') . ' bytes)' : 'NO') . "\n"; |
| 59 | +echo "logo-dark.png exists: " . (file_exists('logo-dark.png') ? 'YES (' . filesize('logo-dark.png') . ' bytes)' : 'NO') . "\n"; |
| 60 | + |
| 61 | +echo "</pre></body></html>"; |
| 62 | +?> |
0 commit comments