Answered by:
The FastCGI process exceeded configured activity timeout

Question
-
User-95264152 posted
I was trying to do a phpbb3 conversion, but the script keeps timing out. I can't figure out how to increase the PHP timeout on IIS7.
I tried adding the following code to the PHP script itself: ini_set('max_execution_time',6000);
I tried increasing the FastCGI "RequestTimeout" to 6000 via the IIS7 tool provided with the admin pack. I also confirmed that this change was taking place in the applicationHost.config.
<fastCgi>
<application fullPath="C:\Program Files\PHP\php-cgi.exe" requestTimeout="6000" instanceMaxRequests="10000" />
</fastCgi>I also increased the sites "Connection time-out" to 6000. yet the script keeps timing out in a reletively short period of time, maybe 30 seconds max. This is the error produced.
HTTP Error 500.0 - Internal Server Error
C:\Program Files\PHP\php-cgi.exe - The FastCGI process exceeded configured activity timeout
Module FastCgiModule Notification ExecuteRequestHandler Handler PHP via FastCGI Error Code 0x80070102 Saturday, July 26, 2008 1:41 AM
Answers
-
User-1653247517 posted
"activityTimeout" is a FastCGI module setting in IIS. If you use the FastCGI UI, you will see it there. Your fastCGI section in appHost config will look something like
<fastCgi>
<application fullPath="<path>" arguments="<args>" activityTimeout="<value"> ...<otherValues>.... />
</fastCgi>
-Kj- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Saturday, July 26, 2008 5:30 PM -
User-1637866776 posted
You can use the approach similar to the one described in this article http://learn.iis.net/page.aspx/208/#Per-site (look for the section "Per-site PHP process pools")
The configuration will looks similar to this:
<fastCgi>
<application fullPath="C:\PHP\php-cgi.exe" arguments="-d my.website=site1" activityTimeout="<value1>" />
<application fullPath="C:\PHP\php-cgi.exe" arguments="-d my.website=site2" activityTimeout="<value2>" />
</fastCgi>
The for each web site define a handler mapping for PHP as below:
Site1:
<system.webServer>
<handlers accessPolicy="Read, Script">
<add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe|-d my.website=site1" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>Site 2:
<system.webServer>
<handlers accessPolicy="Read, Script">
<add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe|-d my.website=site2" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Thursday, July 31, 2008 1:16 AM
All replies
-
User-1653247517 posted
Seems like you are running into activity timeout which defaults to 30 seconds and not request timeout. You can try increasing that.
-Kanwal-Saturday, July 26, 2008 2:44 AM -
User-95264152 posted
where is that? general IIS, fastCGI setting or PHP setting?
I did a search in applicationHost.config for the word "activity" and nothing was found, same with php.ini
I remember in IIS6 in FCGIext.ini there was an "ActivityTimeout" variable, but I don't know what it would be in IIS7.
Saturday, July 26, 2008 3:03 AM -
User-1653247517 posted
"activityTimeout" is a FastCGI module setting in IIS. If you use the FastCGI UI, you will see it there. Your fastCGI section in appHost config will look something like
<fastCgi>
<application fullPath="<path>" arguments="<args>" activityTimeout="<value"> ...<otherValues>.... />
</fastCgi>
-Kj- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Saturday, July 26, 2008 5:30 PM -
User-95264152 posted
thanks.
But how can one set different activityTimeout's for different sites? Say i have one site that sends newsletters and the script takes minutes to run, so it will need a high activityTimeout. but i don't want this high value across my entire server, because thats bad right? Could waste resources on slow loading scripts.
Wednesday, July 30, 2008 10:22 PM -
User-1637866776 posted
You can use the approach similar to the one described in this article http://learn.iis.net/page.aspx/208/#Per-site (look for the section "Per-site PHP process pools")
The configuration will looks similar to this:
<fastCgi>
<application fullPath="C:\PHP\php-cgi.exe" arguments="-d my.website=site1" activityTimeout="<value1>" />
<application fullPath="C:\PHP\php-cgi.exe" arguments="-d my.website=site2" activityTimeout="<value2>" />
</fastCgi>
The for each web site define a handler mapping for PHP as below:
Site1:
<system.webServer>
<handlers accessPolicy="Read, Script">
<add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe|-d my.website=site1" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>Site 2:
<system.webServer>
<handlers accessPolicy="Read, Script">
<add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe|-d my.website=site2" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Thursday, July 31, 2008 1:16 AM -
User-95264152 posted
hmm ok thanks, i might do this.
But I am thinking this might be a bit to maintain and I still can't do it per script with this. Might be a better option to set a relatively high value for the fastCGI timeout then set the php.ini timeout to a lower value. then use the ini_set('max_execution_time',VALUE); command when i need a specific script to have a long timeout.
I am just wondering if there are any concerns with having a long timeout for the fastcgi value?
Thursday, July 31, 2008 5:29 AM -
User1530337939 posted
I myself am trying to change the setting in fcgiext.ini, but one problem the IIS 7 does not seem to have the .ini file. Instead it has a .dll file only in:
Current path: c:\windows\system32\inetsrv
I have tried searching for the file in other foldiers. There are not c:\php foldier as some forums have suggested and the fcgiext.dll file does not have the settings which Im looking for or any other setting.
Pls advise what do do?
Saturday, December 5, 2009 12:13 PM -
User1182189156 posted
What is wrong with the default time-out times? if a php script can not be proccessed in milliseconds in a test enviroment with 0 load, wouldnt that mean that iis and fastcgi are simply hanging or there is some other issue going on with iis? nobody should wait 30 or more seconds for a page to be displayed.
Saturday, January 9, 2010 6:36 AM -
User-681024253 posted
I myself am trying to change the setting in fcgiext.ini, but one problem the IIS 7 does not seem to have the .ini file. Instead it has a .dll file only in:
Current path: c:\windows\system32\inetsrv
I have tried searching for the file in other foldiers. There are not c:\php foldier as some forums have suggested and the fcgiext.dll file does not have the settings which Im looking for or any other setting.
Pls advise what do do?
Hi,
IIS 7 does not using the ini configuration system. You will have to change the configuration settings for the FastCGI applications as directed in the article here: http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/
The configuration can be changed via either Inetmgr (the UI) or appcmd (a command-line tool found in %windir%\system32\inetsrv).
The configuration file (applicationhost.xml) can be found in for %windir%\system32\inetsrv\config for server level configurations. There is also a web.config at the root of your site for any site-level configuration settings.
HTH,
kehand
Monday, February 1, 2010 5:36 PM