File size: 2,390 Bytes
efc9636 |
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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
<?php
/**
* Simple error debugging page for WordPress
*/
// Enable error reporting
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
echo "<h1>WordPress Debug Information</h1>";
// Check PHP version
echo "<h2>PHP Version</h2>";
echo "<p>" . phpversion() . "</p>";
// Check SQLite extension
echo "<h2>SQLite Support</h2>";
if (extension_loaded('pdo_sqlite')) {
echo "<p style='color: green;'>β PDO SQLite extension is loaded</p>";
} else {
echo "<p style='color: red;'>β PDO SQLite extension is NOT loaded</p>";
}
// Check file permissions
echo "<h2>File Permissions</h2>";
$paths = [
'/var/www/html',
'/var/www/html/wp-content',
'/var/www/html/wp-content/database',
'/var/www/html/wp-content/db.php'
];
foreach ($paths as $path) {
if (file_exists($path)) {
$perms = substr(sprintf('%o', fileperms($path)), -4);
echo "<p>$path: $perms</p>";
} else {
echo "<p style='color: red;'>$path: NOT FOUND</p>";
}
}
// Check database file
echo "<h2>Database Status</h2>";
$db_file = '/var/www/html/wp-content/database/wordpress.db';
if (file_exists($db_file)) {
echo "<p style='color: green;'>β Database file exists</p>";
echo "<p>Size: " . filesize($db_file) . " bytes</p>";
} else {
echo "<p style='color: red;'>β Database file does not exist</p>";
}
// Test SQLite connection
echo "<h2>SQLite Connection Test</h2>";
try {
$pdo = new PDO('sqlite:' . $db_file);
echo "<p style='color: green;'>β SQLite connection successful</p>";
} catch (Exception $e) {
echo "<p style='color: red;'>β SQLite connection failed: " . $e->getMessage() . "</p>";
}
// Check WordPress files
echo "<h2>WordPress Files</h2>";
$wp_files = [
'/var/www/html/wp-config.php',
'/var/www/html/wp-settings.php',
'/var/www/html/wp-load.php'
];
foreach ($wp_files as $file) {
if (file_exists($file)) {
echo "<p style='color: green;'>β $file exists</p>";
} else {
echo "<p style='color: red;'>β $file NOT FOUND</p>";
}
}
echo "<h2>Environment Variables</h2>";
echo "<p>HTTP_HOST: " . ($_SERVER['HTTP_HOST'] ?? 'not set') . "</p>";
echo "<p>SERVER_NAME: " . ($_SERVER['SERVER_NAME'] ?? 'not set') . "</p>";
echo "<p>REQUEST_URI: " . ($_SERVER['REQUEST_URI'] ?? 'not set') . "</p>";
echo "<hr><p><a href='/'>Try WordPress again</a></p>";
?> |