PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Ahmed Abdulla   PHP System Information   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Main Page
Class: PHP System Information
Get information about the server on which PHP runs
Author: By
Last change:
Date: 5 months ago
Size: 1,417 bytes
 

Contents

Class file image Download
<!DOCTYPE html>
<html>
<head>
    <title>System Information</title>
</head>
<body>

<h1>System Information</h1>

<?php
// Basic System Information
echo "<strong>System Information:</strong> " . php_uname() . "<br>";

// PHP Version
echo "<strong>PHP Version:</strong> " . phpversion() . "<br>";

// Server Information
echo "<strong>Server Software:</strong> " . $_SERVER['SERVER_SOFTWARE'] . "<br>";
echo
"<strong>Server Name:</strong> " . $_SERVER['SERVER_NAME'] . "<br>";
echo
"<strong>Server IP Address:</strong> " . $_SERVER['SERVER_ADDR'] . "<br>";
echo
"<strong>Server Port:</strong> " . $_SERVER['SERVER_PORT'] . "<br>";

// Environment Variables
echo "<strong>Path:</strong> " . getenv("PATH") . "<br>";
echo
"<strong>User:</strong> " . getenv("USER") . "<br>";

// Loaded PHP Extensions
$extensions = get_loaded_extensions();
echo
"<strong>Loaded PHP Extensions:</strong> " . implode(", ", $extensions) . "<br>";

// Filesystem Information
$totalSpace = disk_total_space("/");
$freeSpace = disk_free_space("/");

echo
"<strong>Total Disk Space:</strong> " . $totalSpace . " bytes<br>";
echo
"<strong>Free Disk Space:</strong> " . $freeSpace . " bytes<br>";

// Memory Usage
echo "<strong>Current Memory Usage:</strong> " . memory_get_usage() . " bytes<br>";
echo
"<strong>Peak Memory Usage:</strong> " . memory_get_peak_usage() . " bytes<br>";
?>

</body>
</html>