我有一个网页,上面有一个按钮,点击它会执行一个单一的php函数。
当用户点击它时,需要51081ms才能返回页面。其中51376ms被Firefox开发者工具中的网络选项卡归类为“等待”。
我在php.ini文件中声明的max_execution_time是30。我也可以在phpinfo文件中看到这个设置。
我的问题是,为什么我的脚本没有在30秒后超时?max_execution_time实际上是在衡量什么?
编辑以包括代码;
我了解哪些部分使用Eloquent表示查询。那么我的代码是这样的吗;
PHP执行
PHP执行
数据库查询
数据库查询
数据库查询
PHP执行...等等?
有人能向我解释一下“引擎盖下面”发生了什么吗?
当用户点击它时,需要51081ms才能返回页面。其中51376ms被Firefox开发者工具中的网络选项卡归类为“等待”。
我在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
吗? - Nico Haase