Hey,
One thing that you might cause you to get that is if
shell_exec
is not set in your PHP.ini file or if you don't have access to that...
You can also check out
PHP Code:
<?php
$reguptime = trim(exec("uptime"));
if ($reguptime) {
if (preg_match("/, *(\d) (users?), .*: (.*), (.*), (.*)/", $reguptime, $uptime)) {
$users[0] = $uptime[1];
$users[1] = $uptime[2];
$loadnow = $uptime[3];
$load15 = $uptime[4];
$load30 = $uptime[5];
} else {
$users[0] = "Unavailable";
$users[1] = "--";
$loadnow = "Unavailable";
$load15 = "--";
$load30 = "--";
}
$uptime = shell_exec("cut -d. -f1 /proc/uptime");
$days = floor($uptime/60/60/24);
$hours = str_pad($uptime/60/60%24,2,"0",STR_PAD_LEFT);
$mins = str_pad($uptime/60%60,2,"0",STR_PAD_LEFT);
$secs = str_pad($uptime%60,2,"0",STR_PAD_LEFT);
}
echo "$loadnow (Load like right right right now) - $load15 (load like 15 minutes ago) and $load30 (load like 30 min ago)";
echo "<br /><br />";
echo "Server up for $days Days and $hours hours $mins minutes and $secs";
?>
Which should work, shows server load and uptime...
From,
Adam