The Solution is probably simple but it has got me stumped for the most part of the day. I'm trying to run webalizer on the fly and basically need to get just the current days data from the apache log file and then run the webalizer on that data. I have Fedora linux with Apache 2 and php5. I am just doing a system call:
system ( "grep 10/Nov/2005 /var/log/httpd/mywebsite/access_log | webalizer");
It pretty obvious that this won't work cos the access_log file in owned by root and when php runs, it runs as apache right? I thought I got this working before but now with apache 2.0 and php 5 it don't work ??? - my error_log file from apache keeps saying permission denied for the grep 10/Nov/2005 /var/log/httpd/mywebsite/access_log command . I run the same command from the shell and it works fine, even if I make the php file a cgi - it runs ok. What am I forgetting here, it won't let me even copy the access_log file. I have chmoded the scripts to 755 but sill no joy. Help this is driving me crazy. I was under the impression that use apache could at least execute a grep command ??
Cheers
R