Drupal: Disable Displaying of PHP Alerts on Site Pages
This article will tell you how to disable showing of PHP alerts on pages of your site. You can find all these notifications in Drupal logs. So you can disable them to show to your site visitors.
Solutions:
Disable this on Error Reporting page
- Open “Error reporting” page
- Drupal 6: admin/settings/error-reporting
- Drupal 5: admin/settings/error-reporting
- Below the page, set “Error reporting” parameter to “Record errors to system log”. Thus errors will be recorded while users will not view them in their browser.
Disable displaying of notifications in php.ini
You can change errors output level in php.ini (configuration file PHP). To do this you should find error_reporting parameter in php.ini file:
error_reporting = E_NONE
Disable displaying of notifications in .htaccess
You can change errors output on remote server supporting .htaccess by adding the following line to .htaccess file in the root of your site:
php_value error_reporting E_NONE
Another option:
php_flag display_errors off
php_flag display_startup_errors off
Disable displaying of notifications in code of PHP-scripts
You can also disable displaying of notifications and alerts in /index.php file before this line:
require_once ‘./includes/bootstrap.inc';
adding the following code there:
error_reporting(0);