[PHP] Maximum execution time of seconds exceeded

Source: Internet
Author: User
# Preface when using ' PHP ' to render page pages, if the program processing time is very long, more than the configuration file (php.ini) set the timeout period, you will see the following prompt: >maximum execution time of seconds Exceeded for example: import large amounts of data into a database; Request resource time too long ... # problem PHP program time-out error message What do I do? # method * Directly modify the configuration file (php.ini) [Timeout] "#默认的最大执行时间是30s, can be modified according to their own needs # if it is 0, that is, never expires max_execution_time = 30;" * Indirect modification of configuration information [Timeout] Add the following code to the PHP execution file: "' Phpset_time_limit (0);" * Refresh output buffer [memory overrun]  1. Perform deferred execution in the loop: Add function ' Sleep '  2. Output buffering: Simultaneous use of ' OB The _flush () ' and ' flush () ' functions send data to the browser ' php
 
  '; Ob_flush (); Flush ();} ```
  • Related Article

    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.