Set nginx + php to upload large files
1. To allow php to upload large files, modify the configuration file php. ini as follows:
File_uploads = on; // whether to allow file upload over HTTP. The default value is ONupload_tmp_dir; // The file is uploaded to the temporary directory of the server. upload_max_filesize = 2 m; // maximum size of the file to be uploaded: post_max_size = 8 m; // The maximum size that can be received by a form POST to PHP, including all values in the form. Max_execution_time = 600; // maximum time (in seconds) for running each PHP page. max_input_time = 600 by default; // The maximum time required for receiving data on each PHP page, the default value is 60 seconds for memory_limit = 8 m; // The maximum memory consumed by each PHP page. The previous mechanism is generally 8 M by default, and is usually 128 m.
2. After the php configuration is complete, nginx still cannot upload large files without the corresponding configuration.
413 Request Entity Too Large
You need to enable nginx. conf and add the following parameters in the http {} Configuration:
Client_max_body_size 50 m; // a maximum of 50 m files can be uploaded.