hello, I want to put a php script in a site on an openbsd 4.2 webserver.
>From what I understand because apache is chrooted, a function that uses an
exec to a system call cannot work.
ie.
<?php
        $s = explode( " ", exec("/var/run/usr/bin/uptime") );
        $a = str_replace( ",", "", $s[3]);
        $uptime = time() - $a;

        $days = floor($uptime/60/60/24);
        $hours = $uptime/60/60%24;
        $mins = $uptime/60%60;
        $secs = $uptime%60;
        echo "This server is up " . $days . " days, " .  $hours  . " hours,
" . $mins . " minutes and " . $secs . "seconds";

?>

only echoes epoch time, "This server is up 14300 days, 5 hours, 49 minutes
and 24seconds"

any ideas how to fix this?

Reply via email to