dongtangyi8962 2012-08-30 02:59
浏览 201

PHP上传多个文件总是给我超时错误

Ok, I don't quite understand why, but no matter what I seem to set in PHP's ini_set function, I am unable to upload multiple files or the files that I'm uploading are too big... I don't understand it. Here's what I am setting so far within the script that handles the $_FILES[] array that is being uploaded when posting the form:

// Try and allow for 3 hours, just in case...
@set_time_limit(10800);

// Try and set some ini settings to buy us some time...
@ini_set('memory_limit', '512M');
@ini_set('upload_max_filesize', '512M');
@ini_set('post_max_size', '550M');
@ini_set('session.gc_maxlifetime', '10800');  // Allows for up to 3 hours
@ini_set('max_input_time', '10800');  // Allows for up to 3 hours
@ini_set('max_execution_time', '10800'); // Allows for up to 3 hours

I am using move_uploaded_file to place it into the specified directory, not sure if that matters or not?

Honestly, how can I allow multiple files to be uploaded without a TIMED OUT ERROR?? If I upload 1 file, seems fine. Not sure if it's a quantity problem with multiple files or the combined files are just too big in filesize? Have tried with like 15MB total filesize, and this produces a TIMED OUT ERROR! arggggg!!!!

What must I do to make this work??

  • 写回答

2条回答 默认 最新

  • duanchu3376 2012-08-30 03:19
    关注

    If you are using an apache server, the server itselfs has a timelimit too.

    Look at the TimeOut directive at apache configuration (by default is 300 seconds)

    You can look at the apache error log too

    If you upload only 2 files ok 1Kb each, works fine?

    评论

报告相同问题?

悬赏问题

  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染