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

NoorDeen's avatar

what is the best way to debug laravel or php application ?

every beginner in php use var_dump to debug there php code . but is there any alternative like xdebug or some thing ?

  • if any one used xdebug . how did you used it to debug your application ?
  • what is your IDE like phpstorm or text editor like sublime-text plugins that you used for debugging ?
0 likes
15 replies
robgeorgeuk's avatar

I think I've heard Jeffrey say that he thinks DD (die and dump) is often a completely valid and quick way to debug.

Like @gregurco said, PhpStorm and XDebug gives you ultimate power but sometimes I use FirePHP https://addons.mozilla.org/en-us/firefox/addon/firephp/ which allows you to log stuff from your PHP code into the Firefox console. Your app runs as normal (no die()) and it works great with AJAX stuff as well.

2 likes
NoorDeen's avatar

thank you @gregurco .

@kayyyy thank you . in the past I was using it but stopped because it slow down my application boot proccess .

@robgeorgeuk i like this one . thank you . but what if use chromeum

NoorDeen's avatar

@kayyyy can you give me some tutorial (video or article) about how to use blackfire to debug laravel ?

neomerx's avatar

PhpStorm (has built-in debugger support). The best tool IMHO

  • dd is a dumper not a debugger
  • debugbar is a log viewer not a debugger
  • blackfire is a profiler not a debugger
3 likes
WebKenth's avatar

Personally i´d prefer `dd( unless i am working with a complex recursive function

But i can see the appeal of running through each line of code and getting all variables.

But since local development is so goddamn fast, me adding a dd() and doing a refresh in the browser seems alot faster than having to start up the debugger :P

and if you need more than one dumped variable you can just chain them dd(value1, value2, ...)

Most of my applications use a Laravel only as a data persistence service which keeps track of the database and relationships and then serves the content to Vue which being a javascript framework means we only have to type debugger; where we want to debug and with chrome you got the dev tools to go through each line very fast

amancuker's avatar

Are there any updates for 2022 year. I could not set up debugger(xdebug) with phpstorm?

Please or to participate in this conversation.