Notes for uploading large files in the php environment. Php environment upload large files need to pay attention to the public environment before the formenctypemultipartform-dataactionupload.phpmethodPOST! -- Precautions for uploading large files in MAX_FILE_SIZEmustprecedethefileinputfie php
Public Environment front-end
Nginx + linux environment considerations
Notes for uploading large files in the php environment:
/Usr/local/php/etc/php-fpm.conf.default
Request_terminate_timeout = 0 // This is the execution time of fastcgi, which is unlimited by default.
Client_max_body_size 256 m;
Fastcgi_buffer_size 256 k;
Fastcgi_buffers' 16 256 k;
Fastcgi_busy_buffers_size 256 k;
Fastcgi_temp_file_write_size 256 k;
Fastcgi_connect_timeout 3000;
Fastcgi_send_timeout 3000;
Fastcgi_read_timeout 3000;
In addition, PHP also needs to be configured:
Memory_limit 512 M
Max_execution_time 0
Post_max_size 256 M
Upload_max_filesize 256 M
Notes for apache and windows
Configure the php. ini file (for example, upload a file smaller than MB)
Search for the following options and modify them.
File_uploads = On; enable the file upload option
Upload_max_filesize = 500 M; maximum number of uploaded files
If you want to upload a large file, the above two files are not enough. you must increase the server cache limit and extend the script execution time.
Post_max_size = 500 M; maximum post size
Max_execution_time = 1800; Maximum execution time of each script; Maximum execution time of in seconds script
Max_input_time = 1800; Maximum amount of time each script may spend parsing request data
Memory_limit = 128 M; Maximum amount of memory a script may consume (128 MB) memory limit
Pipeline public environment front-end form enctype = multipart/form-data action = upload. php method = POST! -- MAX_FILE_SIZE must precede the file input fie...