php max_execution_time实际测量的是什么?

我有一个网页,上面有一个按钮,单击该按钮即可执行一个PHP函数.

用户单击它时,需要51081ms才能返回页面.在我的Firefox开发人员工具中,“网络”选项卡将其中的51376毫秒归类为“等待”.

在我的PHP.ini文件中声明的max_execution_time为30.我在PHPinfo文件中也可以看到此信息.

我的问题是,为什么我的脚本在30秒后不超时? max_execution_time实际测量的是什么?

编辑以包含代码

public function getSlotsByUser (Request $request) {

    $event_id = $request->event_id;
    $user_id = substr($request->user, 4);

    $event = Event::find($event_id);

    $user = User::find($user_id);

    $slots = TimeSlot::where('event_id',$event_id)->get();

    $userSlots = $user->slots;

    foreach($userSlots as $userSlot) {

       $guest = Guest::where('slot_id',$userSlot->id)->where('user_id',$user->id)->first();

       if($guest) {
            $userSlot->guest_id = $guest->id;
            $userSlot->guest_name = $guest->name . ' ' . $guest->surname;
        }
        else {
            $userSlot->guest_id = NULL;
            $userSlot->guest_name = NULL;
        }

        $userSlotIds[] = $userSlot->id;

    }

    $days = new DatePeriod(
         new DateTime($event->start_time),
         new DateInterval('P1D'),
         (new DateTime($event->end_time))->modify('+1 day')
    );

    return view('admin.calendar',compact('event','slots','user','userSlots','userSlotIds','days'));

}

我了解哪些部分代表使用Eloquent的查询.我的代码也去了;

PHP执行

PHP执行

数据库查询

数据库查询

数据库查询

PHP执行…等?

有人可以向我解释“幕后”发生了什么吗?

解决方法:

set_time_limit说:

max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windouws where the measured time is real.

因此,在Linux上,仅计算用于执行PHP代码的时间.

“网络”标签中的等待状态只是告诉您,到目前为止,您没有从网络服务器获得任何响应.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...