Most PHP code execution time is not long. But sometimes, such as waiting for a picture to be uploaded, it may take too long to time out.
The default maximum execution time in php.ini is 30 seconds, which is specified by the Max_execution_time variable in php.ini, and if you have a lot of time to do the work, such as sending lots of emails to a large number of senders, or doing heavy data analysis work, The server will forcibly abort the executing program after 30 seconds, how to solve this problem.
The simplest of course is to modify the value of Max_execution_time in php.ini, but not everyone has the right to modify php.ini, such as the use of web hosting developers, the php.ini on the server is used by many sites, so can not be arbitrarily modified.
Another option is to add ini_set (' max_execution_time ', ' 0 ') to the PHP program, and a value of 0 indicates no execution time limit and how long your program needs to run. If your program is still in beta, it is recommended that you set the time limit to a real number so that the error of the program will be removed from the server.
'; flush (); }?>
At the same time can use Ini_get to save the original set of Max_execution_time, after the operation to restore the original set value.
Here is a simple record of the ~
http://www.bkjia.com/PHPjc/752584.html www.bkjia.com true http://www.bkjia.com/PHPjc/752584.html techarticle Most PHP code execution time is not long. But sometimes, such as waiting for a picture to be uploaded, it may take too long to time out. The default maximum execution time in php.ini is ...