[PHP] set_time_limit-set the maximum script execution time

Source: Internet
Author: User

(PHP 4, PHP 5)

Set_time_limit-set the maximum script execution time

Description void Set_time_limit(Int $seconds)

Set the time allowed for script running, in seconds. If this setting is exceeded, the script returns a fatal error. The default value is 30 seconds.Php. iniOfMax_execution_timeThe defined value if it exists.

When this function is called,Set_time_limit ()The timeout counter is restarted from scratch. In other words, if the timeout value is 30 seconds by default, and 25 seconds are set in the script, as shown in figureSet_time_limit (20). The total running time of the script before the timeout is 45 seconds.

Parameters
seconds

The maximum execution time, in seconds. If it is set to 0 (zero), there is no time limit.

Return Value

No return value.

Note

This function does not take effect. Except for disabling or changing the Security ModePhp. iniThere is no other way.

 

Note:

Set_time_limit ()The function and configuration command max_execution_time only affect the execution time of the script. The maximum time for executing any script that occurs in a system call, stream operation, or database operation that uses system () is not included when the script has been run. This is not the case in Windows where the measurement time is real.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.