title: Avoiding CGI timeout
body: <p>I have a function, that gets a large XML file, then parses it, and then uses the details, to get some more xml files, that are again parsed ( A webshop). </p>
  
  <p>The problem is, that the processing takes about 15-20mins, but the script timeout's before that, and sends me a 500 error message. </p>
  
  <p>Is there a way around this?</p>
  
  <p>I read on a post here, that writing a log message every so often helps avoid this problem, but how do I do that? If I try to echo, write or return something, it just returns the value and ends my function.</p>
  
  <p>Here are the error messages:</p>
  
  <pre><code>[Wed Oct 13 10:34:41 2010] [warn] [client 213.175.111.200] Timeout waiting for output from CGI script /home/virtual/site14/fst/var/www/interpreters/php-script
  [Wed Oct 13 10:34:41 2010] [error] [client 213.175.111.200] Premature end of script headers: php-script
  [Wed Oct 13 10:36:41 2010] [warn] [client 213.175.111.200] Timeout waiting for output from CGI script /home/virtual/site14/fst/var/www/interpreters/php-script
  </code></pre>
  
  <p>Thanks!</p>