Modify the PHP file size limit (windows and linux)

Source: Internet
Author: User
Tags form post
Modify the PHP file size limit (windows and linux)
This section describes how to modify the limit on the size of php files to be uploaded. This section describes how to modify the limit on php files in windows and linux. For more information, see.

This section describes how to modify the size limit of php files to be uploaded.

I. Step 1 in Windows: modify the size limit of POST files under php5. 1. compile php. ini found: max_execution_time = 30, which is the maximum running time of each script, in seconds, changed to: max_execution_time = 150 found: max_input_time = 60, which is the time that each script can consume, the unit is second, and the value is changed to max_input_time = 300.

Find: memory_limit = 128 M, which is the maximum memory consumed by the script operation. change the value as needed. here it is changed to: memory_limit = 256 M.

Locate: post_max_size = 8 M, and the maximum data size for form submission is 8 M. This option does not limit the size of a single file to be uploaded, but restricts the data submitted for the entire form. The restricted scope includes all content submitted by the form. for example, when posting a post, the Post title, content, attachments, etc... Modify it to: post_max_size = 20 M

Find: upload_max_filesize = 2 M, the maximum permitted size of the uploaded file, changed to: upload_max_filesize = 10 M

Step 2: change the file upload size control in Apache to httpd. conf in the Apahce Directory. Add: LimitRequestBody 10485760, that is, 10 M = 10*1024*1024. in some articles, change it to 600000000.

Restart apache to set the required size.

2. in the Linux environment, modify etc/php. ini and find the File Uploadsh area. modify the following parameters: file_uploads = on; whether to allow the File upload through HTTP. The default value is ON, which is to open upload_tmp_dir. the file is uploaded to the place where the temporary files are stored ON the server. if this value is not specified, the system will use the default temporary folder (moodle can not be changed) upload_max_filesize = 8 m; maximum file size allowed to be uploaded. locate the Data Handling area and modify post_max_size = 8 m. It refers to the maximum value received by the form POST to PHP, including all values in the form. After the above four parameters are set for 8 m by default, uploading files smaller than 8 m is generally not a problem. However, if you want to upload a file larger than 8 MB, you only need to set the following parameters:

In the Resource Limits area: max_execution_time = 600; the maximum time for running each PHP page (in seconds). The default value is 30 seconds. max_input_time = 600. The maximum time required for receiving data on each PHP page, the default value is 60 seconds for memory_limit = 8 m. The maximum memory consumed by each PHP page is 8 M by default.

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.