简体   繁体   中英

php error and lumen error both showing on error output

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.

异常或错误的输出

流明异常/handle.php 文件

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();

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM