开发者

In my php script larger file takes longer to upload and its bound by max_execution_time

开发者 https://www.devze.com 2023-01-30 12:27 出处:网络
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 under1MB there was no problem. once i uploaded

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.

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.

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

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.

thanks.


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

ini_set('max_execution_time', 360);


I believe setting the 'max_input_time' php.ini variable will only affect the parsing of input variables, which includes POSTed file uploads.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号