問題描述
我的 PHP Web 應用程序需要將文件(大小約為 2.5 到 3 GB)上傳到服務器.這將如何影響以下指令?
My PHP web application requires files (about 2.5 to 3 GB in size) to be uploaded to the server. How will this impact on following directives ?
在我的案例中需要什么值?
what are the required values in my case?
post_max_size
upload_max_filesize
memory_limit
非常感謝您的幫助.
推薦答案
post_max_size
應該是3G
upload_max_filesize
應該是 3G
memory_limit
視情況而定!!!您將如何處理該文件.如果您要操作文件或執行其他內存密集型作業,則需要設置一個上限.如果您不想設置最大限制,您可以隨時將其設置為 -1
.該值與文件大小無關,而與腳本處理作業所需的物理內存大小有關.
memory_limit
depends!!! what you are going to do with the file. If you are going to manipulate the file or do other memory intensive jobs, then you will need to set a high limit. If you don't want to put a maximum limit, you can always set it to -1
. This value doesn't have to do much with the size of the file, but rather with the size of the physical memory your script needs to handle the job.
對于前兩個,它是您希望上傳的最大文件大小,后綴為簡寫字節值.對于KB
應該是K
,MB
應該是M
,GB
應該是<代碼>G, ...
For the first two, it is the maximum file size you expect to be uploaded, suffixed with a short hand byte value. For KB
should be K
, MB
should be M
, GB
should be G
, ...
這篇關于PHP 上傳大小及其對帖子大小和內存限制的影響的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!