Resolve the PHP Web run timeout problem: Maximum execution time seconds exceeded

Source: Internet
Author: User
Tags form post ini

Today, when testing the program, the following error message appears:

Fatal error: Maximum execution time seconds exceeded into c:inetpubwwwrootry.php on

This means that the execution time of the script exceeds the maximum of 30 seconds. 30 seconds of script execution time, for general web pages, may be a bit long, but I this application is allowed to execute the program in 2 minutes, so, 30 seconds should not be the upper limit. Modifying a program's script optimization may reduce the time it takes to execute the script, but because there are more places to change, this method is not feasible, so it is only possible to modify the 30-second limit.

After consulting the relevant information, the discovery can be modified in php.ini this document.

We open the PHP directory php.ini this file, and then look for "max_execution_time", the default of 30 seconds to the time you need to, such as me, 2 minutes to 120, note that the unit is seconds.

When you have finished modifying, save. Then, do not forget to copy this php.ini file to the c:windows below, here C: for the system disk.

Finally, restart the IIS server. Enter the "Iisreset/restart" command in DOS.

In this way, the 30-second script execution limit time is modified.

Other Related parameter explanation:

Memory_limit = 128M

The maximum memory consumed by each PHP page, the default 128M. If you feel small, you can set a larger point, such as Max_execution_time = 600

File_uploads = On

Whether to allow the switch to upload files over HTTP. The default is on, which is open

Upload_tmp_dir

Files are uploaded to the server where temporary files are stored, and the system default temporary folder is used if unspecified.

Upload_max_filesize = 2m

Maximum number of file sizes allowed to upload. The default is 2M

Post_max_size = 8m

Refers to the maximum value that can be received by the form Post to PHP, including all the values in the form. The default is 8M

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.