FastCGI process exceeded configured activity timeout

I have a function I built that will grab a .csv file and upload information stated then, creating an account for each user in the .csv file.

My issue is I need to be able to do this with thousands of entries in a .csv file but my problem is I get this time out error and not to sure why, as follows:

HTTP Error 500.0 - Internal Server Error
c:\php-fastcgi\php-cgi.exe - The FastCGI process exceeded configured activity 
                             timeout
Detailed Error Information

Module -
FastCgiModule

Notification - 
ExecuteRequestHandler

Handler - 
PHP_via_FastCGI

Error Code -
0x80070102

Here is my CSV function:

http://jsfiddle.net/fS4t4/ - this is in PHP and I just throw it into the javascript section.

How to fix this?

UPDATE: My provider is Winhost


Solution 1:

activityTimeout can be also set (IIS7 and above) from the IIS Manager under the server/IIS/FastCGI Settings/Edit.

Solution 2:

Go to %windir%\system32\inetsrv\fcgiext.ini and locate the ActivityTimeout parameter; copy it into the [php] section. Change the parameter to whatever value you would like, and also make sure that it is not commented out. Restart IIS and you should be good.

activityTimeout can be also set (IIS7 and above) from the IIS Manager under the server/IIS/FastCGI Settings/Edit.

Solution 3:

For IIS 7.5 you can change the setting of file in

C:\Windows\System32\inetsrv\config\applicationHost.config

and find the line below and change as per your requirement

<fastCgi>
    <application fullPath="C:\PHP\php-cgi.exe" idleTimeout="900" activityTimeout="180" requestTimeout="10000" instanceMaxRequests="10000" />
</fastCgi>

DO NOT FORGET TO RESTART SERVER

OR This can be done from UI too:

Open InetMgr (window+R type Inetmgr and hit enter) open inet manager from run command

Filter Fast CGI in inet manager

double click or click edit fastcgi

modify fastcgi setting

enter image description here

Solution 4:

For Windows Server 2008 R2, the default version of IIS that is supplied is IIS 7.5. The solution Dave suggested will not work because that file isn't there.

Instead, try %windir%\system32\inetsrv\config\applicationHost.config to set up the options for the entire server. Look at the <fastCgi> block:

<fastCgi>
    <application fullPath = "C:\php\php-cgi.exe" arguments = "" 
        monitorChangesTo = "" stderrMode = "ReturnStdErrIn500" maxInstances = "4"
        idleTimeout = "300" activityTimeout = "30" requestTimeout = "90" 
        instanceMaxRequests = "5000" protocol = "NamedPipe" queueLength = "1000" 
        flushNamedPipe = "false" rapidFailsPerMinute = "10">
        <environmentVariables>
            <environmentVariable name="PHP_MAX_REQUESTS" value="5000" />
        </environmentVariables>
    </application>
</fastCgi>

Remember to restart your webserver.

I set the activityTimeout to 90 and requestTimeout to 270 to give processes more time to finish their work. This wasn't enough for my problem, but it should at least allow people to find the relevant bits on IIS 7.5.