Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony 3.3 getting stacktrace when an Exception gets thrown over the cli command (eg server:start)

Over my Symfony 3.3 project when I run a cli command such as:

php ./bin/console server:start

Sometimes an error has been thrown eg:

  [Symfony\Component\Debug\Exception\ContextErrorException]      
  Warning: key() expects parameter 1 to be array, boolean given  

So using Xdebug I will debug it, but this it can be time-consuming. So finding its stacktrace would be beneficial in order to put breakpoints to the correct places.

So how can I get the stacktrace over a "systematic" exception that gets thrown over the framework?

like image 432
Dimitrios Desyllas Avatar asked Oct 14 '25 21:10

Dimitrios Desyllas


2 Answers

Specify a level of verbosity, with:

php ./bin/console server:start -v

(or -vv/-vvv)

Reference: Symfony Console - Verbosity Levels

like image 160
Kamafeather Avatar answered Oct 17 '25 12:10

Kamafeather


Yes, it's annoying. It's a know issue of Symfony. It will be fixed as of Symfony 3.4:

like image 33
Tokeeen.com Avatar answered Oct 17 '25 12:10

Tokeeen.com