in reply to Need help with CGI script that won't complete running

You'll have to launch a background process that does the actual job, and let the CGI script return quickly. That way you'll prevent people that aren't patient from interrupting the script, by pressing cancel on their browser. For basic ideas on how to do it, check out merlyn's gem series, the columns for the now defunct magazine WebTechiques, on his website.

In particular, check out column 20 of December 1997: Search in progress page.

My idea is for the script to fork, the parent to quickly finish; maybe let the child fork and exit again, so the parent script can wait for it; and letting the grandchild do the actual work.

Do check out some docs on zombie prevention.

  • Comment on Re: Need help with CGI script that won't complete running