[thelist] tail -f on a web page.

Niklas niklaso at swipnet.se
Thu Jan 25 07:27:53 CST 2007


The syntax for the query should be:

$query = "/path/to/tail -f /path/to/access.log";

You can find the path to the binary by using:
whereis tail

as I see Raoul also wrote a minute ago.


/Niklas

Kane Wilson skrev:
> <?php
> $query = "/var/log/httpd/tail -f access_log";
>
> $result = shell_exec($query);
> echo "<pre>";
> echo "$result";
> echo "</pre>";
>
> ?>
>
> i tried as u said , but it doesn't work on the web page . web page was blank.when i tried on the command line 
> # php tail.php, it gives a message saying ,
>
> [root@ html]# php tail.php 
> sh: /var/log/httpd/tail: No such file or directory
> Content-type: text/html
> X-Powered-By: PHP/4.3.9
>
> any other solution ?
>
>  
> ---------------------------------
> Want to start your own business? Learn how on Yahoo! Small Business.
>   





More information about the thelist mailing list