On Wed, Feb 25, 2009 at 12:51 PM, Jerome Santos <bsdonly...@gmail.com> wrote: > 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 > B B B B $s = explode( " ", exec("/var/run/usr/bin/uptime") ); > B B B B $a = str_replace( ",", "", $s[3]); > B B B B $uptime = time() - $a; > > B B B B $days = floor($uptime/60/60/24); > B B B B $hours = $uptime/60/60%24; > B B B B $mins = $uptime/60%60; > B B B B $secs = $uptime%60; > B B B B echo "This server is up " . $days . " days, " . B $hours B . " 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? > >
cron it to a file and parse that file -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org