0

I get the "Error in exception handler" error very often, mainly because of file permission issue, and sometimes because of error in code.

I want to redirect user to a custom error page every time the system encounters the 'error in exception handler' error.

How do I handle this error?

1 Answer 1

4

It's because Laravel can't write to the logfile. If you don't want logs, you can disable it in app/start/global.php around line 55:

App::error(function(Exception $exception, $code)
{
    Log::error(...); //comment out this line.
});

But honestly, that would be a symptom-treatment instead of a problem-treatment. You should chown the app/storage recursively to the user running the server. Fastest way:

  1. In public/index.php, at the very top, temporarily put in die(`whoami`) just after the opening <?php-tag.
  2. Load any page and copy whatever it prints on the site. Let's say it's www-data.
  3. Fire up a terminal/console, go to your project root and run chown www-data -R app/storage, swapping www-data with whatever you found in step two.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.