Page 1 of 2

CGI Timeout

Posted: Wed Jul 26, 2006 2:17 pm
by ratan
I am running a script with takes in queries from a text file and inserts the resulting data into another table. There are hundreds of queries to be processed. I get this error:

CGI Timeout
The specified CGI application exceeded the allowed time for processing. The server has deleted the process.


I am using IIS / PHP 5 / SQLSERVER / WINDOWS

I have changed the CGI execution time to a very high number. But still it times out after approx 5 minutes.

Please help.

Posted: Wed Jul 26, 2006 5:31 pm
by Ambush Commander
This is because the CGI time limit has been set on a lower level (likely the CGI handler). There is no way you can override this yourself, trying contacting your host and seeing if they'll ease up (I doubt it, because these sorts of restrictions on shared hosting machines are to prevent one user from using up all the CPU)

Posted: Wed Jul 26, 2006 8:30 pm
by ratan
I have full access to the server. It is dedicated for my software. This is for intranet. Pls. let me know if I can change anything else to prevent the time out. Thanks.

Posted: Wed Jul 26, 2006 8:38 pm
by Ambush Commander
I can't say I know much about IIS, but I would recommend looking at the configuration there first. Apache has similar issues.

Posted: Wed Jul 26, 2006 8:44 pm
by ratan
I already changed the cgi timeout in IIS to a very high number. I assume there is something else in IIS or probably php is the culprit.

Posted: Wed Jul 26, 2006 8:45 pm
by Ambush Commander
PHP gives a different error message when a script runs too long.

Have you tried googling the error message?

Posted: Wed Jul 26, 2006 8:53 pm
by ratan
Yeah I have checked a lot of sites. They all pretty much say change cgi timeout in IIS, which I did, with no luck. Thanks for ur help.

Posted: Wed Jul 26, 2006 8:54 pm
by Ambush Commander
Did you reboot IIS?

Posted: Wed Jul 26, 2006 9:05 pm
by neophyte
I've had this problem with IIS as well. Never did figure it out. I think I got to do something else. But the last thing I was looking into was trying to play with the metabase.

Hope that helps.

At anyrate if you do figure it out please post....

Posted: Wed Jul 26, 2006 9:06 pm
by Ambush Commander
In the end, here's the real solution: if you're running maintenance-type scripts, run them via shell and not the web.

Posted: Wed Jul 26, 2006 9:17 pm
by neophyte
Right on! After all http connections are not supposed to last forever.

Posted: Thu Jul 27, 2006 9:01 am
by ratan
I did restart IIS. Thanks for ur help folks.

Posted: Fri Aug 04, 2006 3:29 pm
by ratan
I am not sure how to run the script via shell. Pls. help.

Posted: Fri Aug 04, 2006 4:40 pm
by Ambush Commander
Hmm... it's Windows, so can you set up remote access on it?

Posted: Tue Aug 08, 2006 10:49 am
by ratan
The task right now is just to accomplish running of scripts on my machine. Once that is accomplished I can replicate it on the server, which
is inhouse and physically accessible to me.