View Full Version : Premature end of script headers:
I just finished posting this so I could find a solution.
Moderator-Please notify me if you delete because of a reason known only to you. Or even better tell me where to post this.
I did search "awstats premature" and other strings before waisting anyones time here.
I believe it because my log files are 5.6 meg. I read somewhere solution for this. Cannot find doing search awstats and "log", "size", "php", and other strings.
Would someone please post the thread for this solution.
Also I need to get stats for yestaerday. Same thing please post solution as I have done my due diligence in searching for these strings and do not find the appropriate thread.
All help is appreciated.
Premature end of script headers means there is a problem w/the script (vs. a timeout which could be due to a large file size). It is typically a missing quote, semi-colon or bracket. Are you using AWstats that you installed yourself? Has it ever worked? or is this a new installation? Were there any other messages in your error log?
It's been working fine for long time two years plus.
I've narrowed it down to large log file size.
There is thread posted with a possible solution and I hope someone can direct me to it.
I've cronned it to do two updates so I think this will resolve it.
Please someone post thread number on how to update awstats with old logs.
I sliced my 5meg access_log.1 into two 2.5 meg logs and renamed one to access_log. I updated awstats but this did not give me a statistics update.
How do I update my stats from old logs?
Is this the thread you are thinking of
Thank you JJ.
No thats not the one.
The one I'm looking for is one that describes how to update your AwStats with previous log archives like that of yesterday or any one of the logs with extensions .1 through .6.
I assume these are from the past six days.
Also I think this same thread describes how to break up the log so timeout is not an issue.
I would think it would be as simple as cutting the old log into sizes like 2meg then rename to access_log then update AwStats but I tried this and my number of hits do not change.
Ok heres how to fix a damaged or a large laps in your AwStats file from old log files.
I had two days of laps because the log file was too large 5meg+.
first I had to split the 5meg file into two 2.5meg files.
time stamps of your log entries need to be from oldest to newest.
example. my 5meg file had date and time stamps from:
2/5/04 12am to
2/5/04 11:59pm or onr full day of activity
I took the first half of the 5meg file with time stamps of
12am to 12pm named access_log.#1
12pm to 11:59pm named access_log.#2
Split all log files larger than 2meg into two or more files with a naming sequence that you will easily identify as being from newest log entries to oldest log entries. (I'll explain why later.)
Now open up your awstats conf file in an editor.
Look for DirData entry. This is the place awstats places its working files.
AwStas makes two files per month which tells it what information it has logged.
I was concerned with feb/04 so I renamed /DirData/awstats022002.domain.com.txt to something.bak
Now in the conf file you have in your editor look for LogFile=
this is the name and location of the log file AwStats will be getting data from.
Find the name of the old access_log you want to retrieve data from. In my case I wanted to reconstructed the whole month of Feb
My first day of Feb's log file was called access_log.8
In conf file enter the LogFile="/www/?/log/access_log.8"
I uploaded the conf file and saw no entries for Feb because I had renamed the AwStats working file. I Did a manual update. Now I had log entried for Feb 1.
I kept changing the
LogFile=.../access_log.6 and so on
eacg time I closed the AwStats http window so caching would not be an issue.
Also Each time I changed the LogFile entry I upload the AwStats conf file.
Do this from oldest log files to newest files.
The reason you need to stay from oldest to newest is that AwStats working file has an entry that tells it the last entry in your log file. If your entry is older than an entry in the working file AwStats will not accept it.
I hope this will help those who have lost access data in their AwStats and wish to recover from old log files.
I am not the best at technical writing so I welcome questions if I was not clear above.
To fix the problem I had with log files being too large I had cron update my stats more frequesntly.
BTW: Technically, if you backup your log files, you can reconstruct a whole month of log files in this manner.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.