php wamp服务器中的网关超时错误

问题描述 投票:0回答:1

我在长时间运行的php脚本中收到超时错误。我试图通过使用以下代码来设置执行时间:

ini_set('max_execution_time', 1200);

我也尝试在apache conf文件中设置max_execution_time。但是问题没有解决,仍然有同样的问题。脚本中有一个Firebase云消息传递模块,可将一些数据推送到android设备。当我注释这部分代码时。闸道超时错误未显示。但是该代码在脚本中很重要,无法注释。这可能是什么原因?有人可以帮我吗?

  if ($result->num_rows > 0) {
                        // output data of each row
                        while($row = $result->fetch_assoc()) {
                          $deviceid=$row["id"];
                          $regId=$row["regid"];
                        if($regId != null){
                          $json = $push->getPush();
                          $response = $firebase->send($regId, $json);
                        }

                        }
                    }

该脚本实际上是在表中插入太多行,并使用fcm推送该数据。如果插入的行数较少,则说明该行有效。

php android firebase-cloud-messaging wampserver timeoutexception
1个回答
0
投票

似乎问题与从结果中获取的许多记录有关,您能否在SQL查询中应用限制2,并检查一次。

© www.soinside.com 2019 - 2024. All rights reserved.