1. <?php
  2. /**
  3. * Extracts runtime environment values for maintenance tasks.
  4. *
  5. * This script gathers information about the PHP environment
  6. * without focusing on performance optimization.
  7. */
  8. $phpVersion = phpversion(); // Get the PHP version
  9. $serverName = $_SERVER['SERVER_NAME']; // Get the server name
  10. $httpHost = $_SERVER['HTTP_HOST']; // Get the HTTP host
  11. $documentRoot = $_SERVER['DOCUMENT_ROOT']; // Get the document root
  12. $memoryLimit = ini_get('memory_limit'); // Get the memory limit
  13. $maxExecutionTime = ini_get('max_execution_time'); // Get max execution time
  14. $errorReportingLevel = ini_get('error_reporting'); // Get error reporting level
  15. $uploadDir = ini_get('upload_dir'); // Get the upload directory
  16. $phpFlags = php_sapi_name(); // Get PHP SAPI
  17. $timestamp = time(); // Current timestamp
  18. // Output the collected information
  19. echo "PHP Version: " . $phpVersion . "\n";
  20. echo "Server Name: " . $serverName . "\n";
  21. echo "HTTP Host: " . $httpHost . "\n";
  22. echo "Document Root: " . $documentRoot . "\n";
  23. echo "Memory Limit: " . $memoryLimit . "\n";
  24. echo "Max Execution Time: " . $maxExecutionTime . "\n";
  25. echo "Error Reporting Level: " . $errorReportingLevel . "\n";
  26. echo "Upload Directory: " . $uploadDir . "\n";
  27. echo "PHP SAPI: " . $phpFlags . "\n";
  28. echo "Timestamp: " . $timestamp . "\n";
  29. ?>

Add your comment