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