Introduction to methods to break through the limit on the size of PHP downstream files

Source: Internet
Author: User
Tags php file upload upload php
Breaking through the restrictions on the size of PHP files to be uploaded: PHP files are generally restricted by default. how can I modify the size of PHP files? 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, over 30 seconds, this foot breaks through the PHP file upload size limit method introduction
By default, PHP files are restricted. how can I modify the size of PHP files?

1. general PHP file upload, unless the file is small. it is like a 5 MB file, it may take more than one minute to complete the upload.
However, in php, the longest execution time of the page is 30 seconds by default. that is to say, the script is stopped after 30 seconds.
This causes the web page to fail to be opened. in this case, we can modify max_execution_time.
Search in php. ini
max_execution_time


The default value is 30 seconds.
Max_execution_time = 0
0 indicates no limit
The above modified the timeout time 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 is null.
Change to post_max_size.
post_max_size = 150M


3. the second step is modified, but the maximum size of the php file to be uploaded is 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 MB.
upload_max_filesize = 100M


In addition, it should be noted that in the PHP file upload, post_max_size is better than upload_max_filesize.
If you want to upload php files, refer to the above settings!

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.