Home >Backend Development >PHP Tutorial >Settings required when uploading large files in PHP_PHP Tutorial

Settings required when uploading large files in PHP_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 16:07:35844browse

Needless to say, you still have to look for the PHP configuration file php.ini:)

Open php.ini, first find the

; File Uploads;

area, There are the following parameters that affect file upload:

file_uploads = on ; switch whether to allow file upload via HTTP. The default is ON, that is,

upload_tmp_dir; Files are uploaded to the server where temporary files are stored. If not specified, the system default temporary folder will be used

upload_max_filesize = 8m; Wangwen Business , that is, the maximum allowed upload file size. The default is 2M


in the

; Data Handling;

area, there is another item:

post_max_size = 8m; refers to the form POST The maximum value that PHP can receive, including all values ​​in the form. The default is 8M


Generally, after setting the above four parameters, uploading files of

But if you want to upload a large file >8M, it will definitely work if you only set the above four items. Unless your network really has an upload speed of 100M/S, you still have to care about the following parameters:

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;


max_execution_time = 600 ;The maximum time value (seconds) for each PHP page to run, the default is 30 seconds

max_input_time = 600 ;The data received by each PHP page The maximum time required, the default is 60 seconds

memory_limit = 8m; the maximum memory consumed by each PHP page, the default is 8M


After modifying the above parameters, the network allows Under normal circumstances, you can upload large files.

Okay, you can give it a try now after setting it up. Click on a 200M file to upload it
While you are listening to music, thinking about sex, or coming back from going to the toilet, the program will tell you that the upload is successful~

Test uploading a 200M file on this machine is successful .

Luck~~

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315112.htmlTechArticleNeedless to say, you have to find the PHP configuration file php.ini:) Open php.ini, first find; File Uploads; area, the following parameters that affect file upload: file_uploads=on; Whether...
Statement:
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