Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

npubet's avatar
Level 13

Laravel dd() took too long to respond

I have this weird problem, when after calling dd() function, next request returns "took too long to respond", and after a while page is back. And this happens after every dd (event if it is just a string dd('start'))

I don't event know is it a Laravel problem, because first request with dd works fine, but after "took too long to respond"

Laravel Framework 8.81.0 running with sail on Ubuntu 20

Did anyone experience something like that?

0 likes
8 replies
Tray2's avatar

dd means die and dump and it halts all execution, so any code after it will never run.

npubet's avatar
Level 13

@Tray2 Yes, and it works as it should, but only for the first time. If I remove dd from the code, then after refresh page not responding anymore.

Or even if dd still in the code, first page load works as expected (shows variable), after page refresh shows "This site can't be reached, took too long to respond"

Tray2's avatar

@npubet Show your code for the route and the connected controller.

npubet's avatar
Level 13

@Tray2

Here is screencast, maybe easier to understand what is going on https://youtu.be/ghlH6r3BXEY

Simple route that returns model.

Page load that returns model - OK

Page load with var_dump die - OK

Page load with dd($model) - OK

Another same page load - This site can’t be reached

And after awhile site is back up.

Tray2's avatar

@npubet Like I said show the code that is executed, otherwise we can't help you.

npubet's avatar
Level 13

@Tray2 routes/web.php

Route::get('/test', function() {
    $programm = Programm::latest()->first();
    dd($programm);
});

The code is very simple.

I can use var_dump to debug, but I'm just wondering if anyone else had the same problem and knows how to fix it.

I'm doing remote dev (Amazon ubuntu instance).

npubet's avatar
Level 13

@Tray2 This happens everytime I use dd, otherwise everything is fine.

Okay, thank you for your help, for now I'll be using var_dump

Please or to participate in this conversation.