Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: Disable Displaying of PHP Alerts on Site Pages

Submitted by on February 23, 2011 – 9:48 amNo Comment

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);

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.