Modify PHP upload File size limit

Source: Internet
Author: User

Earlier we learned how to use PHP for file uploads and multiple file uploads. However, in the default configuration of PHP, when the uploaded file size exceeds a certain limit, we will get the following error message:

Warning:post content-length of 625523488 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

The general meaning of the above error message is that the size of the data we submit using the POST request exceeds the maximum server limit (8388608 bytes =8mb).

The reason for the above error is that in the PHP configuration file php.ini , the following configuration information (in the beginning of the line, the php.ini semicolon ";") is present by default. Indicates that the current line is a comment and will not take effect):

  1. Script parses the maximum allowable time, in seconds, for input data (like POST and GET). It is measured from receiving all the data to starting the execution script.
  2. Max_input_time = 60
  3. Allows the client to send the maximum data for a single POST request
  4. Post_max_size = 8M
  5. , whether to turn on file upload function
  6. File_uploads = on
  7. File Upload temporary directory (if not specified, use system default temp directories)
  8. ; Upload_tmp_dir =
  9. Allow a single request to upload the maximum file size
  10. Upload_max_filesize = 2M
  11. Allow a single POST request to upload the maximum number of files simultaneously
  12. Max_file_uploads =

As we can see from the configuration information above, PHP's default configuration information is the "culprit" that causes the file size to exceed the limit when PHP files are uploaded. In the above configuration information, the author has given the Chinese annotation information corresponding to the various instruction options, and we can modify the configuration file according to your actual needs php.ini .

Modify PHP upload File size limit

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.