Tag: Will webserver TMP detail memory Specify system default large file
Ext.: http://blog.csdn.net/zhengwish/article/details/51602059
By setting Nginx client_max_body_size resolution nginx+php upload large files problem:
use Nginx to do webserver, you need to pay special attention when uploading large files Client_max_body _size This parameter, otherwise it will break in Nginx request, in PHP is not logged to access.
General upload large file flow:
First modify php.ini file:
Parameter setting description
File_uploads on whether to allow the switch to upload files over HTTP. The default is on
upload_tmp_dir– file is uploaded to the server where temporary files are stored, if not specified, the system default temporary folder
upload_max_filesize 8m business, That is, the maximum size allowed for uploading files. The default is 2m
Post_max_size 8m refers to the maximum value that can be received by the form Post to PHP, including all values in the form. The default is 8m
Description
In general, after the above four parameters are set, in the network normal situation, uploading <=8m files is not a problem
But if you want to upload large files >8m, It is not necessarily possible to set the above four items. Unless your network really has a 100m/s upload speed, you still have to set the following parameters.
Max_execution_time 600 maximum time value per PHP page (in seconds), default 30 seconds
Max_input_time 600 maximum time per PHP page to receive data, default 60 seconds
Memory_limit 8m per php page to eat the maximum memory, default 8m
But still not, because the webserver with Nginx, Google a bit, Found in Nginx conf added a parameter:
Default is 1M, need to increase.
Add a in the nginx.conf;
Client_max_body_size 30m;
Restart
30m indicates the maximum upload 30M and how large the setting will be.
[go] solve nginx+php uploading large files by setting Nginx client_max_body_size