简体   繁体   中英

How do I disable filp/whoops package in Laravel 5.5 without removing it?

Laravel 5.5 app. Originally 5.3. I installed the filp/whoops package as per the upgrade guide, but now I want to disable it, as I believe it is causing "out of memory" errors on my Homestead machine whenever I encounter an error, which is really annoying because all I see is "allowed memory size of XXXXXX bytes exhausted" instead of the real error, which is usually a parse error of some sort. I do NOT want to change the memory available to PHP as it matches what I have on my production server.

Is there any simple way to disable this package without removing it?

Try to add into app/Exceptions/Handler.php the following method:

protected function renderExceptionWithWhoops(Exception $e)
{
    return $this->renderExceptionWithSymfony($e, config('app.debug'));
}

This will override default implementation and should cause rendering exception without Whoops package.

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