0

I have disabled displaying errors to the user in my D7 website. See below the screenshot of the configuration-

enter image description here

However, I (without admin login) still see a database related error such as following-

enter image description here

How do I disable the above error display to a normal user (but making sure admin can see)? It would be better if these errors can be logged but not displayed to a normal user. By saying a normal user, I am referring to all non-logged users.

2
  • I'm guessing that this is a MySQL connection error in which case Drupal can't fetch the configuration that says not to show errors, so, it shows the error.
    – Kevin
    Commented Feb 20, 2018 at 15:23
  • @Kevin: May be you are right but it is really disappointing to show such error. The error not only tells MySQL server but also directory absolute location. I am worried for the safety! Hence I am looking for a way to disable such errors to end user.
    – ravi
    Commented Feb 20, 2018 at 15:25

1 Answer 1

1

You should be able to add the following to your settings.php to hide all errors (It will mean the admin screen you mentioned will no longer be used so any changes to this setting will need to be done via settings.php

$conf['error_level'] = ERROR_REPORTING_HIDE;

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.