One of the most common questions people seem to ask when attempting to run some form of CGI application or script (such as PHP or Perl) on an IIS 6.0 server is “How do I change the default CGI script timeout value ?“ Quite often this is because they are trying to execute a relatively long-running script in an application and they are seeing the following error message :
“The specified CGI application exceeded the allowed time for processing”
The default value for the CGI script timeout property in the IIS metabase is 300 seconds for both IIS 5.0 and IIS 6.0 In this brief tutorial I will demonstrate the various ways in which you can modify this default value for IIS 5.0 and IIS 6.0
Configuring the CGI Timeout Value in IIS 5.0
In IIS 5.0 there are three ways in which the CGI Timeout value can be modified; these are via the MMC GUI using Internet Services Manager, editing the metabase directly using Metaedit and via the built-in Adsutil admin script. Lets look at each method in turn. Perhaps the easiest way to configure this value is via the GUI using the MMC. To do this open Interface Services Manager, right-click on the Local Machine name and click Properties. This will bring up the Internet Information Services properties dialog box shown here.
In the Master Properties section ensure that the WWW Service is selected and click Edit. The WWW Service Master Properties dialog box will be shown. Click on the Home Directory tab and then click on the Configuration button as shown here.
The Application Configuration dialog box will be presented. Click on the Process Options tab as shown here and you will see that the CGI script timeout value is displayed. Provided it hasn’t been altered you should see the default value of 300 seconds displayed as shown here. You can edit the timeout value directly here.
There is however, one potential drawback with this method (as convenient as it is) namely that any value you specify here will be applied to all of the Web Sites on this server, which may not necessarily be desirable in every situation.
As the above GUI method is somewhat limited you are going to have to delve a bit deeper if you wish to achieve a more granular level of control over these settings on your server and apply different CGI timeout values to individual web sites.One method of doing this is to use the Metaedit tool which is a free download from Microsoft. You can get Metaedit here :
HOW TO: Download, Install, and Remove the IIS MetaEdit 2.2 Utility http://support.microsoft.com/?id=232068
Install and run Metaedit and then browse to the /LM/W3SVC branch of the IIS metabase. Locate the CGI Timeout value and you should see the default value of 300 seconds as shown here.
Using Metaedit you can now configure the desired CGI Timeout value at the individual web site level. Browse to the appropriate Web Site’s properties using Metaedit and then right-click on the Site ID and click New, DWORD.