在我的PHP脚本更大的文件需要更长的时间来上传和其max_execution_time仅仅约束 [英] In my php script larger file takes longer to upload and its bound by max_execution_time

查看:258
本文介绍了在我的PHP脚本更大的文件需要更长的时间来上传和其max_execution_time仅仅约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的PHP脚本更大的文件需要更长的时间来上传和的max_execution_time其绑定。当的max_execution_time设置为60,我是1MB下上传文件也没有问题。有一次,我上载的文件超过3MB我一直得到没有错误的一个空白屏幕就可以了。

In my php script larger file takes longer to upload and its bound by max_execution_time. when max_execution_time was set to 60 and i was uploading files under 1MB there was no problem. once i uploaded a file over 3MB i kept getting a blank screen with no error on it.

不要担心所有上传的限制设置,是的PHP错误显示为上。唯一的办法我能确定的问题是,当我在我的max_execution_time设置为360。

Dont worry all upload limits are set and yes php display errors is on. The only way i was able to determine the problem was when i set my max_execution_time to 360.

在我这样做有时间出来,通过上传成功。

Once i did that there was time out and upload went through successfully.

我的问题是,允许用户上传晚得多文件,也没有办法nowing多久设置为max_execution_time仅仅

my problem is that users are allowed to upload much later files and there is no way of nowing how long to set max_execution_time for.

如果它被设置非常高的,怎么样我把它设置到360秒时,那意味着在理论上每一个PHP程序最多可能需要360秒的执行,这是非常糟糕的。

If it is set really high, like how i have it set to 360 seconds, then that means in theory every php process can take up to 360 seconds to execute, which can be very bad.

有人请帮助我。这是一个文件托管脚本。

Someone please help me. This is a file hosting script.

感谢。

推荐答案

只更改最大执行时间,当用户上传的文件。

Change the max execution time only when users are uploading files.

ini_set('max_execution_time', 360);

这篇关于在我的PHP脚本更大的文件需要更长的时间来上传和其max_execution_time仅仅约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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