PHP Test Page"; echo "
PHP Version: " . phpversion() . "
"; echo "Current Time: " . date('Y-m-d H:i:s') . "
"; // Test SQLite if (extension_loaded('pdo_sqlite')) { echo "✓ SQLite PDO extension is available
"; try { $db_file = '/var/www/html/wp-content/database/wordpress.db'; $pdo = new PDO('sqlite:' . $db_file); echo "✓ SQLite connection successful
"; // Test a simple query $result = $pdo->query("SELECT name FROM sqlite_master WHERE type='table'"); $tables = $result->fetchAll(PDO::FETCH_COLUMN); if (count($tables) > 0) { echo "Database tables found: " . implode(', ', $tables) . "
"; } else { echo "No tables found in database (this is normal for a fresh install)
"; } } catch (Exception $e) { echo "✗ SQLite connection failed: " . $e->getMessage() . "
"; } } else { echo "✗ SQLite PDO extension is NOT available
"; } // Test file permissions echo "$file: $perms
"; } else { echo "$file: NOT FOUND
"; } } // Test WordPress database methods echo "✓ SQLite_DB class loaded successfully
"; // Test required methods $methods = ['set_prefix', 'get_results', 'get_row', 'get_var', 'get_col', 'prepare', 'insert', 'update', 'delete', 'suppress_errors', 'show_errors', 'hide_errors', 'bail', 'timer_start', 'timer_stop', 'get_blog_prefix', '_escape', '_real_escape', '_weak_escape', 'escape', 'add_placeholder_escape', 'placeholder_escape']; foreach ($methods as $method) { if (method_exists($test_db, $method)) { echo "✓ Method $method exists
"; } else { echo "✗ Method $method missing
"; } } // Test properties $properties = ['prefix', 'posts', 'users', 'options', 'ready', 'field_types', 'suppress_errors', 'show_errors', 'time_start', 'blogid', 'base_prefix', 'charset', 'collate', 'dbname']; foreach ($properties as $prop) { if (property_exists($test_db, $prop)) { echo "✓ Property $prop exists
"; } else { echo "✗ Property $prop missing
"; } } } else { echo "✗ SQLite_DB class not found
"; } } else { echo "✗ wp-content/db.php not found
"; } // Test database connection echo "✓ Database connection successful
"; echo "Database type: SQLite (in-memory)
"; echo "Database prefix: " . $db->prefix . "
"; // Test if WordPress tables were created echo "✓ Table '$table_name' exists
"; } else { echo "✗ Table '$table_name' missing
"; } } // Test default options echo "Total options in database: $option_count
"; $test_options = array('siteurl', 'home', 'blogname', 'blogdescription', 'users_can_register', 'admin_email'); foreach ($test_options as $option) { $value = $db->get_var($db->prepare("SELECT option_value FROM {$db->prefix}options WHERE option_name = %s", $option)); if ($value !== null) { echo "✓ Option '$option': $value
"; } else { echo "✗ Option '$option' not found
"; } } echo "Original string: " . htmlspecialchars($test_string) . "
"; echo "_escape(): " . htmlspecialchars($db->_escape($test_string)) . "
"; echo "_real_escape(): " . htmlspecialchars($db->_real_escape($test_string)) . "
"; echo "_weak_escape(): " . htmlspecialchars($db->_weak_escape($test_string)) . "
"; echo "Array escape test:
"; $escaped_array = $db->_escape($test_array); foreach ($escaped_array as $key => $value) { echo "$key: " . htmlspecialchars($value) . "
"; } } else { echo "✗ Database connection failed
"; } echo "