Adjust the PHP file size limit

Source: Internet
Author: User
Adjust the PHP file size limit

  1. Max_execution_time = 30; Maximum execution time of each script, in seconds
  2. Max_input_time = 60; Maximum amount of time each script may spend parsing request data
  3. ; Max_input_nesting_level = 64; Maximum input variable nesting level
  4. Memory_limit = 128 M; Maximum amount of memory a script may consume (128 MB)
  5. ; Maximum size of POST data that PHP will accept.
  6. Post_max_size = 105 M
  7. ; Maximum allowed size for uploaded files.
  8. Upload_max_filesize = 100 M

Generally, when uploading files, you must first ensure the upload memory. check the default configuration of PHP. INI. the default value of memory_limit is 128 MB, which can consume memory for one script execution. If the upload limit is 100 MB, the memory size is sufficient (generally speaking, for example, it may not be enough to upload multiple files simultaneously ).

II. adjust the execution time set_time_limitMax_execution_time is set to 30 seconds by default. For uploading MB files, it is almost impossible to upload MB files in 30 seconds in terms of network conditions. The bandwidth of 10 Mb is completely symmetric, it also takes one minute and a half minutes to get one megabits per second. Therefore, this setting is difficult to estimate the actual execution time even if it is adjusted, and it is too long for APACHE to be unfriendly. Therefore, we recommend that you do not adjust max_execution_time, but use set_time_limit (0); in the PHP program for temporary adjustment. Set 0 to no time limit. Of course, from the perspective of program execution, setting 0 solves the timeout problem, but it is not a good solution. if the program supports resumable data transfer, setting 600 seconds or 3600 seconds also seems to be a better idea. when a timeout occurs, the data can be resumed automatically.

III. restart the APACHE serverService httpd restart articles you may be interested in: breakthrough php file upload size limit configuration method PHP increase file upload size limit how to cancel php file Upload cannot exceed 2 MB limit breakthrough PHP file upload size limit method to modify php file upload size limit method

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.