Home > Backend Development > PHP Tutorial > Things to note when uploading large files in PHP environment_PHP Tutorial

Things to note when uploading large files in PHP environment_PHP Tutorial

WBOY
Release: 2016-07-13 09:53:08
Original
858 people have browsed it

Things to note when uploading large files in PHP environment

Public environment frontend






Send this file:

nginx linux environment precautions


Things to note when uploading large files in PHP environment:

/usr/local/php/etc/php-fpm.conf.default
request_terminate_timeout = 0 //This is the execution time of fastcgi, which is not limited by default
client_max_body_size 256m;

fastcgi_buffer_size 256k;
fastcgi_buffers 16 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
 
fastcgi_connect_timeout 3000;
fastcgi_send_timeout 3000;
fastcgi_read_timeout 3000;

In addition, PHP also needs to be configured:

memory_limit 512M
max_execution_time 0
post_max_size 256M
upload_max_filesize 256M


Things to note in apache windows environment

Configure the php.ini file (taking uploading files below 500M in size as an example)
Find the following options and modify ->
file_uploads = On ;Turn on file upload options
upload_max_filesize = 500M ;Maximum upload file size


If you want to upload a relatively large file, the above two are not enough. You must increase the server cache limit and lengthen the maximum execution time of the script
post_max_size = 500M;post upper limit
max_execution_time = 1800 ; Maximum execution time of each script, in seconds Maximum execution time of script
max_input_time = 1800 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M; Maximum amount of memory a script may consume (128MB) memory limit

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1004540.htmlTechArticleThings to note when uploading large files in PHP environment Public environment front section form enctype=multipart/form-data action=upload .php method=POST !-- MAX_FILE_SIZE must precede the file input fie...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template