PHP configuration File settings upload large files

Source: Internet
Author: User
Tags php file upload
Share under Modify PHP configuration file to set up a large file upload method, break the PHP large file upload limit, interested friends reference.

This section: Set large file upload options in the PHP configuration file.

To upload large files to the server, it is recommended to use the Flash long pass component (within 100M or good) swfupload.

PHP upload file By default does not meet this requirement, refer to the following methods to modify.

1, normal php file upload, unless the file is very small. Like a 5M file, it's likely to take more than a minute to upload. However, in PHP, the default maximum execution time for this page is 30 seconds. That means more than 30 seconds, the script stops executing. This results in a situation where the Web page could not be opened. Max_execution_time in php.ini to find Max_execution_time.

The default is 30 seconds. Change to Max_execution_time = 00 means there is no limit to the above modification is the PHP upload file in the script execution time-out

2, modify post_max_size to set the maximum allowable size for post data. This setting also affects the PHP upload file. PHP default post_max_size is 2M. If the POST data size is larger than post_max_size $_post and $_files superglobals will be empty. Find Post_max_size. Change to Post_max_size = 150M

3, a lot of people will change the second step. However, PHP uploads a file with a maximum value of 8M. We're going to change one. Parameter upload_max_filesize indicates the maximum size of the uploaded file. Find Upload_max_filesize, default is 8M to Upload_max_filesize = 100M

In addition, the PHP file crosses, post_max_size greater than upload_max_filesize is better. With the above changes, PHP file upload large files should be no problem.

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