Why is Set_time_limit (0) in PHP not useful under the IIS server?
Reply to discussion (solution)
How does it not work in the embodiment of?
Set_time_limit (0);
$time _start = time (true);
$chk = false;
while ($chk = = = False) {
$time _end = time (true);
if ($time _end-$time _start > 80) {
printf ("Time out!");
$chk = true;
}
}
This code does not play time out. and reported a 500 error.
It means you don't have to use PHP under IIS ...
500 error is not php.ini in display_errors = On not set, there is a while loop $time _end-$time _start should always be equal to 0
I tested it in the Apache environment. I don't know if it's about service.
500 error is not php.ini in display_errors = On not set, there is a while loop $time _end-$time _start should always be equal to 0
Why $time_end-$time _start should always be equal to 0?
I tested it in the Apache environment. I don't know if it's about service.
How should I set it up in IIS?
I can change the 80 by a little bit.
Exceeded the maximum execution time? Turn on the error prompt function to see.
Oh, add set_time_limit (0); That's okay with the maximum execution time.
Open the error notification function to see if there are any errors.
Several reasons to check:
1. PHP is running in safe mode, and if so, Set_time_limit is invalid.
2. The IIS server itself is configured with a time-out and a higher priority, even if you have PHP set does not time out, due to the server's time-out mechanism, still do time-out processing, so after the timeout will trigger a fatal error, which is the cause of the 500 error.
Refer to this article: http://www.iisadmin.co.uk/?p=7
Oh, add set_time_limit (0); That's okay with the maximum execution time.
Open the error notification function to see if there are any errors.
I opened the error notification function and found no error in log.
Problem solved, and sure enough is the problem of IIS7:
iis7->fastcgi Settings-double-click the "Php-cgi.exe" and "Activity timeout" item by default is set to 70, I change to Maximum, 2592000.