PHP Upload file Size control settings in the configuration file

Source: Internet
Author: User
Tags form post

How to modify Windows environment ================================================================
First step: Modify the limit of post file size under PHP5

1. Editing php.ini

Found: Max_execution_time = 30, this is the maximum time per script to run, in seconds, modified to:
Max_execution_time = 150

Found: Max_input_time = 60, this is the time each script can consume, the unit is also the second, modified to:
Max_input_time = 300

Found: Memory_limit = 128M, this is the script to run the maximum consumption of memory, according to your needs to change the value, this is changed to:
Memory_limit = 256M

Found: Post_max_size = 8M, form submission maximum data is 8M, this item is not limited to upload a single file size, but for the entire form of submission data restrictions. The scope of the restriction includes all content submitted by the form. For example: When posting posts, post title, content, attachments, etc... This is changed to:
Post_max_size = 20M

Found: upload_max_filesize = 2M, upload the maximum allowable size of the file, modified to:
Upload_max_filesize = 10M

Step two: File Upload size control in Apache environment
Modify the httpd.conf in the APAHCE directory
Add the following:
Limitrequestbody 10485760
That is 10m=10*1024*1024, some of the articles mentioned should be changed to 600000000

To restart Apache, you can see the size you want in the settings.

How to modify the Linux environment ================================================================
Modify Etc/php.ini
Locate the file Uploadsh zone to modify the following parameters: File_uploads = on; switch to allow uploading of files over HTTP. The default is on Upload_tmp_dir, the file is uploaded to the server where temporary files are stored, if not specified will be used the system default temporary folder (Moodle can not change)
Upload_max_filesize = 8m; Allows the maximum size of the uploaded file.
Locate the Data handling area, modify Post_max_size = 8m, and the maximum value that can be received from the form post to PHP, including all values in the form. Default is 8M
After setting the four parameters above, uploading files less than 8M is generally not a problem. But if you upload a file larger than 8M, you only have to set the following parameters:
In the resource Limits area: max_execution_time = 600; maximum time value per php page (seconds), default 30 seconds Max_input_time = 600, maximum time per PHP page to receive data, default 60 seconds Me Mory_limit = 8m; max memory consumed per PHP page, default 8M

PHP Upload file Size control settings in the configuration 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.