Home > Backend Development > PHP Tutorial > How to modify the size limit of uploaded files in apache+php

How to modify the size limit of uploaded files in apache+php

WBOY
Release: 2016-07-25 08:54:57
Original
2181 people have browsed it
Introduce the method of modifying the size limit of uploaded files in apache and php environments. Friends in need can refer to it.

When solving the PHP upload file size limit, not only PHP's upload file size limit must be modified, but Apache can also be modified.

System environment: centos 5.5

1. Modify the php file size limit vi /etc/php.ini Find: max_execution_time = 30, this is the maximum time for each script to run, in seconds, modify it to: max_execution_time = 150

Found: max_input_time = 60, this is the time that each script can consume, the unit is also seconds, modify it to: max_input_time = 300

Found: memory_limit = 128M. This is the maximum memory consumed by the script. Change the value according to the needs and modify it to: memory_limit = 256M

Found: post_max_size = 8M, the maximum data submitted by the form is 8M. This item does not limit the size of a single uploaded file, but limits the submitted data of the entire form. The scope of restrictions includes all content submitted in the form. For example: when publishing a post, the post title, content, attachments, etc., are modified to: post_max_size = 20M

Found: upload_max_filesize = 2M, the maximum allowed size of uploaded files, modified to: upload_max_filesize = 10M

2. Modify apache upload file size limit vi /etc/httpd/conf.d/php.conf LimitRequestBody 524288 changes 524288 (=512x1024) to a larger size, such as 5M (=5x1024x1024) The above problems will not occur when uploading. The upload does not respond. If the page cannot be uploaded, it will be solved!



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template