PHP configuration file settings upload large files

Source: Internet
Author: User
Tags php file upload
PHP configuration file settings upload large files
I will share with you how to modify the php configuration file to set the method for uploading large files and break through the php large file upload restrictions. For more information, see.

This section describes how to set the large file upload option in the php configuration file.

To upload large files to the server, we recommend that you use the flash persistent data transfer component (within MB) swfupload.

PHP files uploaded by default cannot meet this requirement. refer to the following method for modification.

1. generally, php files are uploaded unless the files are small. like a 5 MB file, it may take more than one minute to complete the upload. however, in php, the longest execution time of this page is 30 seconds by default. that is to say, the script is stopped after 30 seconds. this leads to the failure to open the webpage. in this case, we can modify max_execution_time in php. search max_execution_time in ini

The default value is 30 seconds. changing to max_execution_time = 00 indicates that the above modification is not limited by the time-out period for script execution in php file uploading.

2. modify post_max_size to set the maximum size allowed by POST data. This setting also affects php file upload. The default post_max_size of php is 2 MB. if the size of POST data is larger than that of post_max_size $ _ POST and $ _ FILES superglobals, it will be blank. search for post_max_size. change to post_max_size = 150 M.

3. many people will change the second step. but the maximum size of the file uploaded by php is still 8 MB. why? we need to change the parameter upload_max_filesize to indicate the maximum size of the uploaded file. Find upload_max_filesize. the default value is 8 M, which is changed to upload_max_filesize = 100 M.

In addition, it is better to upload a php file with post_max_size greater than upload_max_filesize. With the above modifications, it should be okay to upload a large php file.

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.