PHP timeout hint fatal error:maximum EX

Source: Internet
Author: User
Due to the many loops involved in the recent procedures and the complexity of processing, the execution timeout prompt when running the program is as follows:
Fatal error:maximum execution time of seconds exceeded in D:\php\AppServ\www\sum3\test.php on line 3

By searching online, find the following solutions to share with you:

This error is to say that your PHP
Execution time crosses the maximum execution time set in the configuration file for 30 seconds, which is not a problem with your program itself, and
is a system configuration file problem, if your network speed, may be executed again will not appear this error, but

There are three ways to make certain changes to this problem:
1. Modify the PHP configuration file, find the php.ini file, it should generally be placed in your C:\WINDOWS directory, and then find
Max_execution_time = 30;//set to the value you want, in seconds


This line, which is the maximum execution time for a setting of 30 seconds, you can modify this value to change your expectations. (can also be directly set to: Max_execution_time = 0)


2. Use the Ini_set () function, not everyone can modify the php.ini file, then you can use this function to change your maximum execution time limit value, such as:
Ini_set (' max_execution_time ', ' 100 ');
is set to 100 seconds, you can also set to 0, that is, do not limit the time of execution.
3. Using the Set_time_limit () function, Set_time_limit (20) represents the maximum execution time plus 20 seconds, but if PHP executes safe mode, Set_time_limit () will not have results unless you use the first method.


The following is a partial explanation: set_time_limit---Limit the maximum execution time Set_time_limit (PH3, PHP4) set_time_limit---Limit the maximum execution time syntax: void set_time_limit (int s Econds) Description: Sets the number of seconds that a program is allowed to execute, and if the time limit is reached, the program returns an error.

Its preset limit time is 30 seconds, the value of max_execution_time is defined in the structure file (in PHP3 called Php3.ini, in the PHP4 is called php.ini), if the number of seconds is set to 0, indicating no time limit.

When this function is called, Set_time_limit () calculates the maximum execution time from zero, that is, if the maximum execution time is a preset of 30 seconds, and it takes 25 seconds to execute the program before calling this function Set_time_limit (20). The maximum time that the program executes will be 45 seconds.

Note: When PHP is executed in safe mode, Set_time_limit () will not have results unless it is switched off in safe mode or modified in the structure file (called Php3.ini in PHP3, PHP4 is called php.ini) time limit.

Original address: http://www.alixixi.com/program/a/2011110575885.shtml

The above describes the PHP timeout hint fatal error:maximum EX, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.