Prevent error displaying in the browser

The following error displays in the browser if the database details are configured incorrectly:
[nativecode=Access denied for user ‘asteriskuser’@‘localhost’ (using password: YES)] ** mysql://asteriskuser:password@localhost/asterisk

How do i prevent this from displaying?

I looked in php.ini and display_errors = Off. What setting am I missing?

Thanks

Cameron