The maximum execution time of PHP scripts. Most PHP code will not be executed for a long time. However, sometimes, for example, waiting for image upload, the execution time may be too long, leading to timeout. The default maximum execution time in php. ini is 30. most PHP code will not be executed for a long time. However, sometimes, for example, waiting for image upload, the execution time may be too long, leading to timeout.
Php. the default execution time in ini is 30 seconds. the max_execution_time variable in ini specifies that if you have a job that takes a lot of time to complete, such as sending a lot of emails to a large number of recipients, or performing heavy data analysis, the server will forcibly stop the program being executed 30 seconds later. how can this problem be solved.
The simplest of course is to modify php. max_execution_time value in ini, but not everyone has the right to modify php. ini, for example, developers who use web hosting, php on the server. ini is used by many websites, so it cannot be modified at will.
Another method is to add ini_set ('max _ execution_time ', '0') to the PHP program. The value 0 indicates that there is no execution time limit, and your program will run as long as it takes. If your program is still in the test phase, we recommend that you set a real number for the time limit to avoid program errors that take the server away.
'; Flush () ;}?>
At the same time, you can use ini_get to save the previously set max_execution_time and reply to the original set value after the operation.
Here is a simple record ~
Bytes. However, sometimes, for example, waiting for image upload, the execution time may be too long, leading to timeout. The default maximum execution time in php. ini is 30...