[thelist] tail -f on a web page.
Niklas
niklaso at swipnet.se
Thu Jan 25 06:10:41 CST 2007
Hi,
In PHP you can use the function shell_exec() to get the results you want.
For example (very simplified):
<?
$query = "/usr/local/bin/tail -f access.log";
$result = shell_exec($query);
echo "<pre>";
echo "$result";
echo "</pre>";
/Niklas
Ben Joyce skrev:
> Can you execute the tail command with in PHP script and write the
> output to the page? You can use "tail -f --lines=100" to view more
> lines if needed, then refresh the page to view the new activity.
>
> I don't know about Apache but in IIS the log files are updated in 64K
> chunks, not in real-time - something you might need to be aware of.
>
> Ben
>
> On 1/25/07, Kane Wilson <gsm_color at yahoo.com> wrote:
>
>> Hi,
>>
>> When we do the tail -f access.log in a linux box for apache webserver , we can view the logs / transactions realtime .
>>
>> I wanted to display that on a web page. How can i do it via php ? and what is the best way to do it ?
>>
>> please help me .
>>
>>
>> Thank you,
>> Kane.
>>
>>
>> ---------------------------------
>> 8:00? 8:25? 8:40? Find a flick in no time
>> with theYahoo! Search movie showtime shortcut.
>> --
>>
>> * * Please support the community that supports you. * *
>> http://evolt.org/help_support_evolt/
>>
>> For unsubscribe and other options, including the Tip Harvester
>> and archives of thelist go to: http://lists.evolt.org
>> Workers of the Web, evolt !
>>
>>
More information about the thelist
mailing list