"DF" output
| From: | Steven Shepherd | Date: | Tue, 27 Mar 2001 17:18:05 +0000 |
| Subject: | "DF" output | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45746@lists.php.net to get a copy of this message | ||
I am writing a script, actually modifying PhPSysInfo to include the top
processes used on a machine. So far, no matter what I do, I can only get
it to work via the command line. I get a blank screen when trying it via
the browser:
Tried this:
<?php
$data =
ps auxwww; echo nl2br($data);
?>
------------------------------------------------
and this:
<TT>
<PRE>
<?php
exec("/usr/bin/top n 1 b | head -8 | sed 's/[\$|^M]//g'", $top);
while (list(,$line) = each($top)){
echo $line, "<BR>\n";
}
?>
</PRE>
</TT>
I used sed to remove control characters..etc. Again, both examples above
work via the command line, but not via a browser. User "www" is able to
run this command as well, so it's not permissions. Help?! :)