<?php
// Simple server test file
echo "Server is working!<br>";
echo "PHP Version: " . phpversion() . "<br>";
echo "Current Time: " . date('Y-m-d H:i:s') . "<br>";
echo "Server Software: " . $_SERVER['SERVER_SOFTWARE'] . "<br>";

// Test if mod_rewrite is available
if (function_exists('apache_get_modules')) {
    $modules = apache_get_modules();
    echo "mod_rewrite: " . (in_array('mod_rewrite', $modules) ? 'Available' : 'Not Available') . "<br>";
}

// Check if important directories exist
$dirs = ['application', 'system', 'vendor'];
echo "<br>Directory Check:<br>";
foreach ($dirs as $dir) {
    echo "$dir: " . (is_dir($dir) ? 'Exists' : 'Missing') . "<br>";
}

// Test database connection if config exists
if (file_exists('application/config/database.php')) {
    echo "<br>Database config file: Found<br>";
} else {
    echo "<br>Database config file: Missing<br>";
}

phpinfo();
?>