> -----Original Message----- > From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 8:18 AM > To: [EMAIL PROTECTED] > Subject: Why "Premature end of script headers"? > > > Hi all, > > I've made a little script that takes the lines from a file, > removes the > dupplicate lines and prints the result to a new file. > I've read the original file line by line because it is a big > file (over 7 > MB). > The problem is that after printing almost 10% from the > original file into > the new file, the script dies and the only error I get in the > log file is: > > [Mon Jul 15 14:44:48 2002] [error] [client 127.0.0.1] Premature end of > script headers: clean.pl > > I've checked the original file to see if there are some > strange characters > in that line, or in the next one, but I haven't found > something that might > cause that problem. > > Please tell me why is the script dying only after it runs for > a few minutes, > and after writing over 11000 lines, and not from the > beginning, if there is > a problem with the script. > > Can you find any problems with my scriptt?
Probably your web server is timing out the request and killing your script. Web servers don't like to run long-running processes like this. Perhaps you can fork off a child and have the child take care of it. See http://www.stonehenge.com/merlyn/WebTechniques/col20.html for a nice technique on this. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]