0

I've set max_execution_time to 0, set memory_limit to '-1' and time limit 15 minute for FastCGI but getting a "500 - Internal Server Error" when running a PHP script more than 1 minute.

Anyone have any ideas why this cannot run more than 1 minutes even when I specifically set it for a longer period?

  • You'll need to check your error log for details about this error. Without seeing the specific error that triggered the 500 response it could literally be _anything_. – MrWhite Jan 13 '17 at 11:19
  • @w3dk I am getting following error HTTP Error 500.0 - Internal Server Error C:\PHP\php-cgi.exe - The FastCGI process exceeded configured request timeout – Bimal Bavalava Jan 13 '17 at 12:12

1 Answers1

0

https://stackoverflow.com/questions/17824462/internal-server-error-500-after-90-seconds-of-php-script-running/18729592

The solution is to increase the FastCGI activity timeout. Use appcmd, the IIS command line tool, to modify the IIS configuration XML file.

Run cmd in an administrator mode.

To check the current settings use:

%windir%\system32\inetsrv\appcmd list config -section:system.webServer/fastCgi

To add the activity timeout (assuming CGI location is C:\php\php-cgi.exe):

%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /[fullPath='C:\php\php-cgi.exe'].activityTimeout:600

This output now should be similar to this:

<fastCgi>
<application fullPath="C:\PHP\php-cgi.exe" activityTimeout="600" instanceMaxRequests="10000">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
</environmentVariables>
</application>
</fastCgi>
</system.webServer>
dim
  • 1