Modify the PHP file size limit

Source: Internet
Author: User
Modify the PHP file size limit
This section describes how to modify the php file size limit. the default file upload size in php is 2 MB. here we will share the specific modification method. For more information, see.

1. 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. the default value of max_execution_time in ini is 30 seconds. if you change to max_execution_time = 00, there is no limit.

2. modify post_max_size to set the maximum size allowed by POST data. This setting also affects 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. after completing Step 2 modification, the maximum size of the uploaded file is still 8 MB. you need to modify the upload_max_filesize parameter 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, post_max_size is better than upload_max_filesize.

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.