PHP script time-out settings

Source: Internet
Author: User

There are several ways to set the time-out for PHP script execution:
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.
First, in the php.ini inside set max_execution_time = 1800;
Second, through the PHP ini_set function set Ini_set ("Max_execution_time", "1800");
Third, through the Set_time_limit function set Set_time_limit (1800);

PHP script time-out settings

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.