CatPtain/wordpress
0
1<?php2/**3 * Simple error debugging page for WordPress4 */5 6// Enable error reporting7ini_set('display_errors', 1);8ini_set('display_startup_errors', 1);9error_reporting(E_ALL);10 11echo "<h1>WordPress Debug Information</h1>";12 13// Check PHP version14echo "<h2>PHP Version</h2>";15echo "<p>" . phpversion() . "</p>";16 17// Check SQLite extension18echo "<h2>SQLite Support</h2>";19if (extension_loaded('pdo_sqlite')) {20 echo "<p style='color: green;'>✓ PDO SQLite extension is loaded</p>";21} else {22 echo "<p style='color: red;'>✗ PDO SQLite extension is NOT loaded</p>";23}24 25// Check file permissions26echo "<h2>File Permissions</h2>";27$paths = [28 '/var/www/html',29 '/var/www/html/wp-content',30 '/var/www/html/wp-content/database',31 '/var/www/html/wp-content/db.php'32];33 34foreach ($paths as $path) {35 if (file_exists($path)) {36 $perms = substr(sprintf('%o', fileperms($path)), -4);37 echo "<p>$path: $perms</p>";38 } else {39 echo "<p style='color: red;'>$path: NOT FOUND</p>";40 }41}42 43// Check database file44echo "<h2>Database Status</h2>";45$db_file = '/var/www/html/wp-content/database/wordpress.db';46if (file_exists($db_file)) {47 echo "<p style='color: green;'>✓ Database file exists</p>";48 echo "<p>Size: " . filesize($db_file) . " bytes</p>";49} else {50 echo "<p style='color: red;'>✗ Database file does not exist</p>";51}52 53// Test SQLite connection54echo "<h2>SQLite Connection Test</h2>";55try {56 $pdo = new PDO('sqlite:' . $db_file);57 echo "<p style='color: green;'>✓ SQLite connection successful</p>";58} catch (Exception $e) {59 echo "<p style='color: red;'>✗ SQLite connection failed: " . $e->getMessage() . "</p>";60}61 62// Check WordPress files63echo "<h2>WordPress Files</h2>";64$wp_files = [65 '/var/www/html/wp-config.php',66 '/var/www/html/wp-settings.php',67 '/var/www/html/wp-load.php'68];69 70foreach ($wp_files as $file) {71 if (file_exists($file)) {72 echo "<p style='color: green;'>✓ $file exists</p>";73 } else {74 echo "<p style='color: red;'>✗ $file NOT FOUND</p>";75 }76}77 78echo "<h2>Environment Variables</h2>";79echo "<p>HTTP_HOST: " . ($_SERVER['HTTP_HOST'] ?? 'not set') . "</p>";80echo "<p>SERVER_NAME: " . ($_SERVER['SERVER_NAME'] ?? 'not set') . "</p>";81echo "<p>REQUEST_URI: " . ($_SERVER['REQUEST_URI'] ?? 'not set') . "</p>";82 83echo "<hr><p><a href='/'>Try WordPress again</a></p>";84?>