in reply to Re^2: ERROR on CGI script:The timeout specified has expired
in thread ERROR on CGI script:The timeout specified has expired

Not that I know of, but I only know what the Apache folks said on that bug report. Try running your query from the command line. The bug report suggests that the timeout isn't actually because your script takes 300sec to execute, but because the volume of output it produces breaks Apache's attempts to keep up with it.

I'd suggest running your script on the command line to determine:

That should give you a better idea of what you can reduce (time or output).

  • Comment on Re^3: ERROR on CGI script:The timeout specified has expired