<?php
// Check Apache configuration
echo "<h2>Apache Configuration Test</h2>";

// Check if Apache is running
echo "Server Software: " . $_SERVER['SERVER_SOFTWARE'] . "<br>";
echo "Server Protocol: " . $_SERVER['SERVER_PROTOCOL'] . "<br>";
echo "Server Name: " . $_SERVER['SERVER_NAME'] . "<br>";
echo "Server Port: " . $_SERVER['SERVER_PORT'] . "<br>";

// Check PHP configuration
echo "<h2>PHP Configuration</h2>";
echo "PHP Version: " . phpversion() . "<br>";
echo "PHP SAPI: " . php_sapi_name() . "<br>";
echo "Document Root: " . $_SERVER['DOCUMENT_ROOT'] . "<br>";

// Check loaded modules
echo "<h2>Loaded Modules</h2>";
if (function_exists('apache_get_modules')) {
    echo "Apache Modules:<br>";
    print_r(apache_get_modules());
} else {
    echo "Apache module check not available<br>";
}

// Check PHP extensions
echo "<h2>PHP Extensions</h2>";
print_r(get_loaded_extensions());

// Check file permissions
echo "<h2>File Permissions</h2>";
echo "Current Directory: " . getcwd() . "<br>";
echo "Is Writable: " . (is_writable('.') ? 'Yes' : 'No') . "<br>";
echo "Is Readable: " . (is_readable('.') ? 'Yes' : 'No') . "<br>";
?> 