Subscribe Newsletter

Your Name  : 
Email Address *  : 
  • Online: Get Electricity Bill Now on Mobile and Email | Bala-Krishna
  • webs.com: com and type in the IP address you want to convert into its decimal url,...
  • PNR Status: check multiple pnr status with a single click PNR Status
  • Click here: Cheers for the informative blog post, I truly appreciated it. I would...
  • Leela: Only site on web which allows checking of Multiple Train PNR Status with a...
  • PUNEET: getting authentication error in digsby while opening yahoo email accounts,...
  • Arvind Pandit: Search your bank SWIFT code online | Bala-Krishna
  • pokemon: Wordpress WP_Categories doesn?t exist Error Fix | Bala-Krishna
  • Jambula Hanmanth Reddy: SIR/MADAM, I have forgot my username,password,and...
  • Jitendrakumar: This is working Perfectly. Thanks Buddy
  • ashfaq: nice post it well me lot no 1 has solution for this problem
  • irctc pnr status: This is useful information to know the pnr status. Thanks for...
  • Maria: How? How do you change the Digsby default yahoo server to the new one?...
  • Archives

  • Blog Stats

Control PHP Error Reporting With .htaccess

Create .htaccess file or use existing .htaccess file in your hosting site. Add below line at the top of file content.
[sourcecode language='php']
# to stop php startup errors
php_flag display_startup_errors off
# to stop all php errors and warning
php_flag display_errors off
[/sourcecode]
You can also control level of error reporting. Here is the .htaccess syntax:
[sourcecode language='php']
# php directive for setting error level
php_value error_reporting integer
[/sourcecode]
Example:
[sourcecode language='php']
# report everything except run-time notices.
php_value error_reporting 8191
# report both fatal and non-fatal compile-time warnings by the Zend Engine
php_value error_reporting 128
# report run-time notices, compile-time parse errors, run-time errors and warnings
php_value error_reporting 8
# report fatal run-time errors and unrecoverable errors
php_value error_reporting 1
[/sourcecode]


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

3 Responses to “Control PHP Error Reporting With .htaccess”

  1. I am not new to blogging and truly value your site. There is much innovative subject that peaks my interest. I am going to bookmark your web site and keep checking you out.

  2. Hello..
    How not to display any notices and display the rest?

    php_value error_reporting 8191 does show notices.

  3. I’m with Martyn, how do you do: error_reporting(E_ALL ^ E_NOTICE); ???

Leave a Reply