search

Home  >  Q&A  >  body text

Lumen application does not show stack trace in debug mode

<p>I have two Lumen microservices that (as far as I know) have the same configuration. One displays a user-friendly error page and the other does not. </p> <p>Both services have this simple controller method: </p> <pre class="brush:php;toolbar:false;">public function test() { echo $a; exit; }</pre> <p>One of the services only shows: </p> <blockquote> <p>Oops! An error occurred The server returns "500 Internal Server Error". Something is broken. Please let us know what you are doing when this error occurs. We will fix it as soon as possible. sorry cause any inconvenience. </p> </blockquote> <p>Other services show stack traces, etc. </p> <p><code>APP_DEBUG=true</code> and <code>APP_ENV=local</code> on both environments. I verified these settings by echoing them in the controller method. </p> <p>What setting might I be missing that prevents me from seeing the stack trace? </p>
P粉959676410P粉959676410517 days ago552

reply all(1)I'll reply

  • P粉684720851

    P粉6847208512023-09-03 13:32:39

    The problem is that I have a config/app.php file in which the debug setting is missing. Adding 'debug' => env('APP_DEBUG', false), to the array solved my problem.

    reply
    0
  • Cancelreply