Set the size limit system uploaded in NGINX

By setting the client_max_body_size of nginx to solve the problem of nginx+php uploading large files:
When using nginx as a webserver, you need to pay special attention to the client_max_body_size parameter when uploading large files, otherwise the request in nginx will be interrupted Access is not recorded in php.
General upload process of large files:
First modify the php.ini file:
Parameter setting instructions
file_uploads on Whether to allow file uploads via HTTP switch . The default is ON, which is to open
upload_tmp_dir – upload files to the server where temporary files are stored, if not specified, the system default temporary folder will be used
upload_max_filesize 8mWangwen Business, That is, the maximum file size allowed to be uploaded. The default is 2M
post_max_size 8m refers to the maximum value that can be received by POST to PHP through the form, including all the values ​​in the form. The default is 8M
Description
Generally speaking, after setting the above four parameters, it is not a problem to upload files of <=8M under normal network conditions.
But if you want to upload>8M files For files, only setting the above four items may not work. Unless your network really has a high upload speed of 100M/S, you have to continue to set the following parameters.
max_execution_time 600 The maximum time for each PHP page to run (seconds), the default is 30 seconds
max_input_time 600 The maximum time required for each PHP page to receive data, the default is 60 seconds
memory_limit 8m per PHP page The maximum memory eaten is 8M by default.

But it still doesn’t work, because the webserver uses nginx. I googled it and found that a parameter was added to the nginx conf:
The default is 1M, which is required Increase it.
Add a sentence to nginx.conf
client_max_body_size 30m; Restart it. 30m means the maximum upload is 30M, and how big is required to set.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4679 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.