26 (edited by Smartys 2005-10-26 21:17)

Re: Admin page not coming up

Edit: My mistake, basically $load_averages is filled with the results

Try removing the @ from exec('uptime')

27

Re: Admin page not coming up

Removed "@".

The page won't load.

28 (edited by Smartys 2005-10-26 21:57)

Re: Admin page not coming up

Edit: new code

<?php

$s = explode( " ", exec("/sbin/sysctl -n kern.boottime") );
$a = str_replace( ",", "", $s[3]);
$uptime = time() - $a;    

?>

Oh, and what's your PHP_OS set as?

29

Re: Admin page not coming up

macosx wrote:

FreeBSD 5.2.1 with PHP 4.4.0 and MySQL 4.0.18

Used your new code. It won't load the page.

Re: Admin page not coming up

Try this:

  $data = shell_exec('uptime');
  $uptime = explode(' up ', $data);
  $uptime = explode(',', $uptime[1]);
  $uptime = $uptime[0].', '.$uptime[1];

Re: Admin page not coming up

What is weird about this isn't that it can't determine the load averages but that the page doesn't even load properly.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

32

Re: Admin page not coming up

Smartys: Still not loading with that new code
Rickard: It is very odd... As soon as I pull out any of the uptime code it works fine...

Re: Admin page not coming up

What's even more weird about this is that the script never outputs anything, not even a blank page (macosx sent me a link). It doesn't appear to timeout either. It's been "loading" in one of my firefox tabs for 10 minutes now. I wonder if this only happens on files that don't exist. What happens if you place this script in your PunBB root folder:

<?php

if (file_exists('index.php'))
    echo 'yes';
else
    echo 'no';

?>
"Programming is like sex: one mistake and you have to support it for the rest of your life."