PHP上传大小及其对帖子大小和内存限制的影响 [英] PHP upload size and its impact on post size and memory limit

查看:201
本文介绍了PHP上传大小及其对帖子大小和内存限制的影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的PHP Web应用程序需要将文件(大小约2.5至3 GB)上传到服务器。如何影响下面的指令?

在我的情况下需要的值是多少?




  • post_max_size

  • upload_max_filesize

  • memory_limit


  • <

    解决方案


    1. post_max_size 应该是 3G


    2. upload_max_filesize 应该是 3G


    3. memory_limit 取决于!你将要做什么与文件。如果您要操作文件或执行其他内存密集型工作,则需要设置最高限制。如果您不想设置最大限制,则可以将其设置为 -1 。这个值并不是文件的大小,而是脚本处理作业所需的物理内存的大小。

    对于前两个,它是您希望上传的最大文件大小,后面加上一个简短的字节值。对于 KB 应该是 K MB 应该是 G code>,...


    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

    Your help will greatly be appreciated.

    解决方案

    1. post_max_size should be 3G

    2. upload_max_filesize should be 3G

    3. 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.

    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上传大小及其对帖子大小和内存限制的影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆