Today, I ran into two colleagues who reacted to my failure to upload a large file (8M)!
is usually in PHP code to use the post parameters to upload files, when the size of the file is larger than 8M, upload cannot succeed.
First, I think of the Nginx client_max_body_size parameter, which defines the maximum value of the body of the HTTP request that Nginx receives. The value of Client_max_body_size setting in the nginx.conf configuration file is 8M. Increase this value, reload Nginx and then re-test. If the file still cannot be uploaded, the most probable cause of the error is the configuration of PHP.
Check the PHP error log, which contains the following records
PHP warning:post content-length of 8947356 bytes exceeds the limit of 8388608 bytes in Unknown on line 124
It is obvious that the post parameter maximum is also 8388608bytes (8M), modify the Post_max_size parameter value in php.ini, and restart the PHP-FPM service process to resolve the problem.
It is also important to note the file_uploads, upload_max_filesize, Memory_limit, and other parameter values in the php.ini configuration file.
Uploading large files using post parameters in PHP code