I want to process my access log in php - checking some IPs, which are leeching content and so on, everything in PHP, running as CLI. I tried to make following, but it never pass exec tail -f, so, actually I can not process the data. Any help appreciated.
$log = '/var/log/lighttpd/web.org-access.log';
$pipefile = '/www/web.org/tmp/fifo.tmp';
if(file_exists($pipefile))
if(!unlink($pipefile))
die('unable to remove stale file');
umask(0);
if(!posix_mkfifo($pipefile,0777))
die('unable to create named pipe');
exec("tail -f $log > $pipefile 2>&1 &"); //I tried nohup and so on...
//exec("varnishncsa $log > $pipefile 2>&1 &"); //will be here instead tail -f
echo "never comes here"; //never shows up
If possible, I want to do it just in PHP, no bash/tcsh scripting (I know how to do it using those).
Thanks.