php error and lumen error both showing on error output

2.4k Views Asked by At

How can I fix this issue in lumen framework?

I am getting the PHP default errors and lumen framework exception both at the same time.

Here I have attached the screenshot of both files. The output and the exception handler PHP file.

Output of the exception or error

lumen exception/handle.php file

2

There are 2 best solutions below

1
Chukwuemeka Inya On

Oh... You need to try any of the following:

Method 1

Assuming you are running apache web server and php 7.2 on an Ubuntu PC. Go to your php.ini file (/etc/php/7.2/apache2/php.ini), search for display_errors and set it to Off.

If Method 1 doesn't fix it for you, try Methods 2:

Method 2

Go to the index.php inside the public folder of your app and turn off display_errors like so:

ini_set('display_errors', 0);   //Set this before $app->run();
1
Nava Bogatee On

To display the comprehensive error, I added the following configurations.

config/app.php

return [
    'debug' => (bool) env('APP_DEBUG', true),
    'env' => env('APP_ENV', 'production'),    
];

.env

APP_ENV=local
APP_DEBUG=true