How do I close an HTTP connection before my script finishes. I want it to keep processing data after it has sent a reply to the client. Apache normally closes the connection only after the script finishes. I tried unbuffering and closing STDOUT to no avail.
I was waiting to see if anyone else had done this trick. No chimers having chimed in, I take a guess....
I don't know if this will achieve the desired effect, but....... I would try separating the code into two chunks (one file with two parts). The first would be the chunk that would do all of the web response work. Then, it would launch the second chunk via an 'exec'. My hope would be that the web server would see the initial process close and thus the connection would close..... meanwhile... the child created by the 'exec' would go on it's merry way doing what ever you like. Like I said/wrote, I have not tried this, but, it is the first place I thought I would start playing.
I don't have time to try it today. I'll try to get back to it and if it works I'll post a little code. If you are new to Tek-Tips, please use descriptive titles, check the FAQs,
and beware the evil typo.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.