Re: [PHP] php not reading file properly

2008-08-25 Thread Jochem Maas
sean greenslade schreef: Well, if you really want to know, I have to go to many places that do not have internet access. For those places, I have a PDA. I have Avantgo software on the PDA, and I wanted it to be able to store a copy of the log file to review it when I do not have internet access.

Re: [PHP] php not reading file properly

2008-08-25 Thread sean greenslade
Yeah, well, I don't want everyone to view my logs. Only me. So it won't add any unnecessary load to my server. On Mon, Aug 25, 2008 at 8:04 AM, Jochem Maas [EMAIL PROTECTED] wrote: sean greenslade schreef: Well, if you really want to know, I have to go to many places that do not have

Re: [PHP] php not reading file properly

2008-08-24 Thread Jochem Maas
sean greenslade schreef: I have this snippet of code that is supposed to read the apache access log and display it: ?php $myFile = /var/log/httpd/access_log; $fh = fopen($myFile, 'r'); $theData = fread($fh, filesize($myFile)); fclose($fh); echo This weeks apache log

Re: [PHP] php not reading file properly

2008-08-24 Thread sean greenslade
Well, if you really want to know, I have to go to many places that do not have internet access. For those places, I have a PDA. I have Avantgo software on the PDA, and I wanted it to be able to store a copy of the log file to review it when I do not have internet access. All I needed was a webpage

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread sean greenslade
www.ashleysheridan.co.uk -- Forwarded message -- From: sean greenslade [EMAIL PROTECTED] To: Micah Gersten [EMAIL PROTECTED] Date: Wed, 20 Aug 2008 19:41:54 -0400 Subject: Re: Fwd: [PHP] php not reading file properly Ashley Sheridan wrote: As it's the Apache access log that you

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread Ashley Sheridan
things. Ash www.ashleysheridan.co.uk -- Forwarded message -- From: sean greenslade [EMAIL PROTECTED] To: Micah Gersten [EMAIL PROTECTED] Date: Wed, 20 Aug 2008 19:41:54 -0400 Subject: Re: Fwd: [PHP] php not reading file properly Ashley Sheridan wrote: As it's the Apache

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread sean greenslade
: Fwd: [PHP] php not reading file properly So I made a cron jop to copy the log to the web folder every 5 minutes. That worked fine. It seems that php can't read the /var/log/httpd folder without root perms. On Wed, Aug 20, 2008 at 7:53 PM, Ashley Sheridan [EMAIL PROTECTED]wrote: Yeah, Apache

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread Ashley Sheridan
: [PHP] php not reading file properly So I made a cron jop to copy the log to the web folder every 5 minutes. That worked fine. It seems that php can't read the /var/log/httpd folder without root perms. On Wed, Aug 20, 2008 at 7:53 PM, Ashley Sheridan [EMAIL PROTECTED]wrote: Yeah, Apache

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread sean greenslade
PROTECTED] To: php-general@lists.php.net Date: Fri, 22 Aug 2008 10:04:07 -0400 Subject: Re: Fwd: [PHP] php not reading file properly Yeah, I tried changing the perms, and that didn't work. I originally made the cron job put the temp copy in the same logs folder, but it refused to open that. I changed

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread Ashley Sheridan
2008 10:04:07 -0400 Subject: Re: Fwd: [PHP] php not reading file properly Yeah, I tried changing the perms, and that didn't work. I originally made the cron job put the temp copy in the same logs folder, but it refused to open that. I changed it to put the temp copy in the web folder, and it can

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread Micah Gersten
Subject: Re: Fwd: [PHP] php not reading file properly So I made a cron jop to copy the log to the web folder every 5 minutes. That worked fine. It seems that php can't read the /var/log/httpd folder without root perms. On Wed, Aug 20, 2008 at 7:53 PM, Ashley Sheridan [EMAIL

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread sean greenslade
not run into this problem before. Ash www.ashleysheridan.co.uk -- Forwarded message -- From: sean greenslade [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Fri, 22 Aug 2008 10:13:37 -0400 Subject: Re: Fwd: [PHP] php not reading file properly Yeah, but it wouldn't read

Re: Fwd: [PHP] php not reading file properly

2008-08-22 Thread sean greenslade
-- Forwarded message -- From: sean greenslade [EMAIL PROTECTED] To: php-general@lists.php.net Date: Fri, 22 Aug 2008 10:04:07 -0400 Subject: Re: Fwd: [PHP] php not reading file properly Yeah, I tried changing the perms, and that didn't work. I originally made the cron job put the temp

[PHP] php not reading file properly

2008-08-20 Thread sean greenslade
I have this snippet of code that is supposed to read the apache access log and display it: ?php $myFile = /var/log/httpd/access_log; $fh = fopen($myFile, 'r'); $theData = fread($fh, filesize($myFile)); fclose($fh); echo This weeks apache log (clears every sunday morning):.

Re: [PHP] php not reading file properly

2008-08-20 Thread Steve Holmes
On Wed, Aug 20, 2008 at 3:15 PM, sean greenslade [EMAIL PROTECTED]wrote: I have this snippet of code that is supposed to read the apache access log and display it: ?php $myFile = /var/log/httpd/access_log; $fh = fopen($myFile, 'r'); $theData = fread($fh, filesize($myFile));

Fwd: [PHP] php not reading file properly

2008-08-20 Thread sean greenslade
Thanks for the advice. I changed the perms to 777 and changed the user and group to apache, but it still won't open. On Wed, Aug 20, 2008 at 3:35 PM, Robbert van Andel [EMAIL PROTECTED]wrote: Does the user your PHP instance runs as have access to the file? It's possible that it runs under a

Re: Fwd: [PHP] php not reading file properly

2008-08-20 Thread Micah Gersten
If the directory above it doesn't have execute privileges, it won't be able to read it either. Also, why not use the PHP5 function file_get_contents()? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com sean greenslade wrote: Thanks for the advice. I changed

Re: Fwd: [PHP] php not reading file properly

2008-08-20 Thread Ashley Sheridan
As it's the Apache access log that you are trying to read in, are you sure that Apache is not in the process of writing to it as you are attempting to read from it? That might explain why it seems to be empty, although I would have thought it would just append the data to the end of the file,

Re: Fwd: [PHP] php not reading file properly

2008-08-20 Thread sean greenslade
Ashley Sheridan wrote: As it's the Apache access log that you are trying to read in, are you sure that Apache is not in the process of writing to it as you are attempting to read from it? That might explain why it seems to be empty, although I would have thought it would just append the

Re: Fwd: [PHP] php not reading file properly

2008-08-20 Thread Ashley Sheridan
Yeah, Apache is still running, but it is the access log you are trying to read, at the same time that you are Apache is being accessed. Accessing the log from the terminal will be fine while Apache is running, as it is unlikely it is being accessed at the very same instant. Are you able to access