Question about set_time_limit (0? On the iis server, why does set_time_limit (0) in php not work?
Reply to discussion (solution)
Why is it ineffective?
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 output time out. And the error 500 is reported.
Indicates that php has not been used in iis...
500 error is not set in php. ini display_errors = On, and the while loop $ time_end-$ time_start should always be equal to 0
I tested successfully in the apache environment. I don't know if it is related to the service.
500 error is not set in php. ini display_errors = On, and the while loop $ time_end-$ time_start should always be equal to 0
Why should $ time_end-$ time_start always be equal to 0?
I tested successfully in the apache environment. I don't know if it is related to the service.
How should I set it in iis?
I can change 80 to a smaller value.
Exceeds the maximum execution time? Enable the error prompt function.
Oh, added set_time_limit (0); that has nothing to do with the maximum execution time.
Enable the error prompt function to check whether an error is reported.
Troubleshoot for several reasons:
1. whether php runs in safe mode. If yes, set_time_limit is invalid.
2. the IIS server is configured with a timeout value and has a higher priority. even if you set a no-timeout value for php, the server will still perform timeout processing due to the timeout mechanism. Therefore, a fatal error will be triggered after the timeout, this is the cause of 500 error.
Refer to this article: http://www.iisadmin.co.uk /? P = 7
Oh, added set_time_limit (0); that has nothing to do with the maximum execution time.
Enable the error prompt function to check whether an error is reported.
I turned on the error prompt function and found no error prompt in the log.
After the problem is solved, it is really the iis7 problem:
IIS7-> FastCGI Settings-> double-click "php-cgi.exe"-> "activity timeout" item is set to 70 by default, I changed to the maximum value, 2592000.