<?php
/**
* Extracts runtime environment values for maintenance tasks.
*
* This script gathers information about the PHP environment
* without focusing on performance optimization.
*/
$phpVersion = phpversion(); // Get the PHP version
$serverName = $_SERVER['SERVER_NAME']; // Get the server name
$httpHost = $_SERVER['HTTP_HOST']; // Get the HTTP host
$documentRoot = $_SERVER['DOCUMENT_ROOT']; // Get the document root
$memoryLimit = ini_get('memory_limit'); // Get the memory limit
$maxExecutionTime = ini_get('max_execution_time'); // Get max execution time
$errorReportingLevel = ini_get('error_reporting'); // Get error reporting level
$uploadDir = ini_get('upload_dir'); // Get the upload directory
$phpFlags = php_sapi_name(); // Get PHP SAPI
$timestamp = time(); // Current timestamp
// Output the collected information
echo "PHP Version: " . $phpVersion . "\n";
echo "Server Name: " . $serverName . "\n";
echo "HTTP Host: " . $httpHost . "\n";
echo "Document Root: " . $documentRoot . "\n";
echo "Memory Limit: " . $memoryLimit . "\n";
echo "Max Execution Time: " . $maxExecutionTime . "\n";
echo "Error Reporting Level: " . $errorReportingLevel . "\n";
echo "Upload Directory: " . $uploadDir . "\n";
echo "PHP SAPI: " . $phpFlags . "\n";
echo "Timestamp: " . $timestamp . "\n";
?>
Add your comment