I have a web page which has a button on it that when clicked executes a single php function.
When a user clicks it, it takes 51081ms to return a page. 51376ms of this is something that's classed as 'Waiting' by the Network tab in my Firefox developer tools.
The max_execution_time declared in my php.ini file is 30. I can see this in my phpinfo file too.
My question is, how come my script doesn't time out after 30 seconds? What is max_execution_time actually measuring?
Edit to include code;
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'));
}
I understand which parts represent queries using Eloquent. So does my code go ;
php execution
php execution
database query
database query
database query
php execution... etc.?
Can someone explain to me what's going on 'under the hood'?