Lumen application does not show stack trace in debug mode
P粉959676410
2023-09-02 14:50:57
<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>
The problem is that I have a
config/app.php
file in which thedebug
setting is missing. Adding'debug' => env('APP_DEBUG', false),
to the array solved my problem.