Home  >  Article  >  Backend Development  >  Set nginx and PHP upload file size limit

Set nginx and PHP upload file size limit

WBOY
WBOYOriginal
2016-07-29 09:10:441348browse

Modify the php.ini file:

<code>file_uploads on 是否允许通过HTTP<strong>上传文件</strong>的开关。默认为ON即是开
upload_tmp_dir – 文件上传至服务器上存储临时文件的地方,如果没指定就会用系统默认的临时文件夹
upload_max_filesize 8m 望文生意,即允许<strong>上传文件</strong>大小的最大值。默认为2M
post_max_size 8m 指通过表单POST给PHP的所能接收的最大值,包括表单里的所有值。默认为8M
max_execution_time 600 每个PHP页面运行的最大时间值(秒),默认30秒
max_input_time 600 每个PHP页面接收数据所需的最大时间,默认60秒
memory_limit 8m 每个PHP页面所吃掉的最大内存
</code>

Modify the nginx.conf file:

client_max_body_size request body cache size
client_body_buffer_sizeMaximum value for uploaded files

<code>http {
    ......
    client_max_body_size 30m;
    client_body_buffer_size 30m;
    ......
}
</code>

Restart PHP and nginx

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces how to set the upload file size limit for nginx and PHP, including the content of uploading files. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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