Sorry, I should have included this in the first email...

Here's my full code.  Page is called like this:


<FONT SIZE="2" COLOR="#000000" FACE="Tahoma">
echo "<B>Excecuting:</B> tail -n $len
/www/hosting/domains/lanolot/logs/$open <BR>";
echo "<I>Displaying the last <B>$len</B> lines of

exec("tail -n $len /www/hosting/domains/lanolot/logs/$open", $result);

  foreach ($result as $val) {
    echo "$val<br>";



When I call the page, I get the expected at the top:
Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
Displaying the last 150 lines of error.log...

But there's nothing underneath it.

Any help would be greatly appreciated.


----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 5:58 PM
Subject: Re: [PHP] Tailing a log file {!?}

On Saturday 04 May 2002 15:32, Liam MacKenzie wrote:
> OK, I did this and it does nothing but cause a loop and crash my
> <?
> exec("tail -n 100 /www/logs/access.log",$result);
> for ($i=0; $i<$result; $i++)
> {
>   echo "$result<BR>";
> }
> ?>
> What's the problem with that?

An infinite loop most likely. Remember, $result is an array. Try:

  foreach ($result as $val) {
    echo "$val<br>";

Jason Wong -> Gremlins Associates ->
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

This is National Non-Dairy Creamer Week.

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to