I was just monitoring my magento website, and all of a sudden mysql went down for few seconds and Magento throw an error visible for everyone on the homepage / index. This error contained the MySql Password & User ID... If somebody else is monitoring the website as I did, they for sure now know the password of MySql...

How can I disable Magento from outputting any kind of errors on the frontend?!?!

here's the error (those in red are the password and id)


  • If you "fixed" the "Error Processing Request" screen to show errors instead of writing them to a file, go unfix it... It's not supposed to be used in a production environment. – Fiasco Labs Dec 28 '15 at 22:49

Ensure developer mode isn't enabled, and disable error display:

ini_set('display_errors', 0);

| improve this answer | |
  • Thank you! Yep, it was set to 1. I've changed it to 0... hope this hides the errors on frontend because it's frustrating to see your DB password outputted like that. – Aniruddh Bhagwat Dec 28 '15 at 22:19
  • 2
    Don't run Magento on production in Developer Mode! – philwinkle Dec 28 '15 at 22:22
  • it just did it again... – Aniruddh Bhagwat Dec 28 '15 at 22:36
  • Your host may not allow ini_set a phpinfo(); after your ini_set in index.php can determine if its in the disable_functions list. I'd also be quick to save it, load the page, and comment out the phpinfo() so others won't see it but may help shed light on the current php.ini settings of your host. – B00MER Dec 28 '15 at 23:14
  • I've just tried and this was the msg by magento: There has been an error processing your request Exception printing is disabled by default for security reasons. Error log record number: 592149129780 – Aniruddh Bhagwat Dec 28 '15 at 23:39

If it was my server I would turn off error messages and have them fail with no output to the customer. To do this depends on your server and configuration, but hopefully your hosting company can help if you do not have ssh access to it. This is one method you can try if you just want to do some testing On the index.php add this error_reporting(0);

That should hide all error messages.

| improve this answer | |
  • 1
    It appears Boomer beat me to the answer, nicely done sir. – RussellAlbin Dec 28 '15 at 22:15
  • Thank you for the suggestions, Russell. I'm definitely going to ask them in the matter and see. – Aniruddh Bhagwat Dec 28 '15 at 22:21
  • @RussellAlbin Have an up vote, happy holidays! ;) – B00MER Dec 28 '15 at 22:29
  • Woo hoo! Thanks boomer. If you have any magento questions let me know. I am trying to share my knowledge. Been using stack exchange for years and now it's time to pay back. – RussellAlbin Dec 30 '15 at 2:34
  • I meant to add that your have proven yourself pretty knowledgeable in Magento so you probably won't need me! Have a great day. – RussellAlbin Dec 30 '15 at 2:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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