CGI Timeout

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

ratan
Forum Commoner
Posts: 28
Joined: Thu Jul 13, 2006 4:22 pm

CGI Timeout

Post 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.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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)
ratan
Forum Commoner
Posts: 28
Joined: Thu Jul 13, 2006 4:22 pm

Post 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.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
ratan
Forum Commoner
Posts: 28
Joined: Thu Jul 13, 2006 4:22 pm

Post 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.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

PHP gives a different error message when a script runs too long.

Have you tried googling the error message?
ratan
Forum Commoner
Posts: 28
Joined: Thu Jul 13, 2006 4:22 pm

Post 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.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Did you reboot IIS?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post 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....
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Right on! After all http connections are not supposed to last forever.
ratan
Forum Commoner
Posts: 28
Joined: Thu Jul 13, 2006 4:22 pm

Post by ratan »

I did restart IIS. Thanks for ur help folks.
ratan
Forum Commoner
Posts: 28
Joined: Thu Jul 13, 2006 4:22 pm

Post by ratan »

I am not sure how to run the script via shell. Pls. help.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Hmm... it's Windows, so can you set up remote access on it?
ratan
Forum Commoner
Posts: 28
Joined: Thu Jul 13, 2006 4:22 pm

Post 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.
Post Reply