How can PHP code be automatically embedded in HTML files for storage space monitoring without root or shell access in a Linux environment?

To automatically embed PHP code in HTML files for storage space monitoring without root or shell access in a Linux environment, you can use a combination of PHP and JavaScript. The PHP code will retrieve the storage space information, and the JavaScript code will dynamically update the HTML content with this information. This way, you can monitor storage space without needing root or shell access.

<?php
$disk_total = disk_total_space("/");
$disk_free = disk_free_space("/");
$disk_used = $disk_total - $disk_free;
$disk_percentage = round(($disk_used / $disk_total) * 100, 2);
?>

<!DOCTYPE html>
<html>
<head>
    <title>Storage Space Monitoring</title>
</head>
<body>
    <h1>Storage Space Monitoring</h1>
    <p>Total Space: <?php echo round($disk_total / (1024*1024*1024), 2); ?> GB</p>
    <p>Used Space: <?php echo round($disk_used / (1024*1024*1024), 2); ?> GB</p>
    <p>Free Space: <?php echo round($disk_free / (1024*1024*1024), 2); ?> GB</p>
    <p>Usage Percentage: <?php echo $disk_percentage; ?>%</p>
</body>
</html>