Reputation: 797
plz i'm facing here a problem ; using doctrine 2 zf2 when there 's many connections it throws this exception ; the problem is not about the excpetion but about that it showing up the login and the password of the DB ... how can i fix it , how can i at least avoid showing the password and the login? thanks.
Upvotes: 1
Views: 284
Reputation: 6932
If you're in development, this kind of information is useful. However, if you're in production, you should avoid outputting this kind of errors. Modify your php.ini
configuration as soon as possible setting display_errors = off
Also try to catch exceptions and handle them using try/catch blocks in your code.
UPDATE
If you have display_errors = off
in your php.ini
and the errors are still showing up, it could be possible that you were overriding that clause somewhere in your code using ini_set
sentences or that you're using another php.ini
file (there could be more than one).
If you are in production, you'll have to remove those ini_set
or override them again using the sentence ini_set('display_errors', 'Off');
where suitable.
Those are PDO exceptions and the message isn't something you can modify so the only way to avoid this problem is to capture exceptions or to avoid showing them turning off the display_errors
thing.
Upvotes: 1