1

Wanted to test 404 error page on our beta site. Set devMode to "false" in general.php. When I do this and try to view inner pages on the website, we receive an "internal server error". All inner pages fail and report "internal server error". The homepage works fine. Any ideas?

4
  • Is it a Craft-styled Internal Server Error page or a web server styled one? If it's Craft, then the underlying error message should be in the Craft log files. Otherwise, it should be in your web server's error logs.
    – Brad Bell
    Commented Sep 24, 2019 at 22:42
  • Looks like a Craft-styled error page (white box in the center of the page). I'm not even sure what to look for in the Craft log files if it is indeed a Craft error. And, curiously, why would Craft throw a server error when switching devMode to false, but work just fine when set to true?
    – BrianMc
    Commented Sep 25, 2019 at 17:46
  • Nuke the Craft logs, reproduce the issue, then search for [error] in the Craft logs and see what comes up.
    – Brad Bell
    Commented Sep 25, 2019 at 19:43
  • Glad you're sorted, @BrianMc - would you mind adding that as an official answer instead of a comment? Might end up helping someone in the future.
    – Brad Bell
    Commented Sep 26, 2019 at 18:51

1 Answer 1

3

Cleared the log files found at /storage/logs/web.log.

Tried to view an inner page on the website which threw a Craft "Internal Server Error".

Inside the log, I saw "Twig\Error\SyntaxError: Unknown "dump" function".

Googled that message and found the solution.

For other newcomers, when you set devMode to true, the dump() function is available in your templates. When you set devMode to false, dump() is not available and Craft throws an internal server error.

That is why my inner pages would not load.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.