<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
 
echo "✓ PHP is working<br>";
 
// Test session
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
echo "✓ Session started<br>";
 
// Test config.php
try {
    require_once('config.php');
    echo "✓ config.php loaded successfully<br>";
} catch (Exception $e) {
    die("✗ Error loading config.php: " . $e->getMessage());
}
 
// Test database connection
try {
    $test = $pdo->query("SELECT 1");
    echo "✓ Database connection working<br>";
} catch (Exception $e) {
    die("✗ Database error: " . $e->getMessage());
}
 
// Test if users table exists
try {
    $result = $pdo->query("SELECT COUNT(*) FROM users");
    echo "✓ Users table exists<br>";
} catch (Exception $e) {
    die("✗ Users table error: " . $e->getMessage());
}
 
echo "<hr>";
echo "✓ All systems working!<br>";
echo "If you see this page, the server is fine and login.php must have a specific error.";
?>
 