duanmei1350 2018-06-07 14:46
浏览 28
已采纳

PHP上传脚本停止/暂时不返回

I have built a PHP script for uploading data from Excel (~40KB size) into DB sent via an Ajax request. It will insert 200 events, 500 registrations (Registrations for the events calendar pro plugin), insert around 500 users and pages and create 1000 PDFs.

It will insert/create this one by one (first events, then registrations etc.) and when I upload a smaller batch, the entire script works just fine. I can hereby upload the entire data, just in smaller pieces.

However, when I upload the entire data, it will always stop at the 3rd step (the insert of the users) and it will always do it at around 200 users without returning anything anymore - In the Console - Network Inspector it is still running.

I have increased the PHP settings to very high, but the error still exists:

memory_limit = 8216M
max_execution_time = 3600
max_input_time = 3600
post_max_size = 1028M
upload_max_filesize = 1028M

Can there be any setting either in PHP, Server or Wordpress that can cause this issue? I am just lost now after sitting on this now for a couple of days, if anyone has a hint or idea, thanks a lot in advance.

  • 写回答

1条回答 默认 最新

  • duanfeng7756 2018-06-07 17:59
    关注

    Like all the commentors are stating, the tasks you are trying to complete feel a bit much for an ajax call.

    I'm guessing you regularly update the Excel file and need to update it to WP?

    Is it ok if I was to return the ajax call after each insert-step and then start a new one.

    Sure that's an option, i've build many ajax batch loaders for collecting large data sets and sending mail. This way you also circumvent PHP script timeouts.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line