Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-01-2009
Member
 
Join Date: Oct 2008
Posts: 37
Error reporting levels in PHP

What are the error reporting levels in PHP? Any PHP error like a simple syntax error causes error 500 and I get no useful info on the php error, can that be changed?
Reply With Quote
  #2  
Old 19-01-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Error reporting levels in PHP

In PHP, the error reporting level (whether errors go to the log or to the screen or whatever) is determinded by the error_reporting INI directive (or at runtime using the error_reporting() function). Both take an integer as their value - and usually this integer is represented by error level constants like E_ALL, E_STRICT or E_USER_WARNING.

So in order to set the error reporting to anything but notices and strict errors, you would set something like this in php.ini:

Code:
  1. error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
Reply With Quote
  #3  
Old 19-01-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Error reporting levels in PHP

Here is a table of different error levels, all linking back to PHP.net

error_reporting() level constants and bit values
Reply With Quote
  #4  
Old 19-01-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Error reporting levels in PHP

If you want to hide errors on a PHP page or just show really critical ones, you can try this,
Code:
// Report all PHP errors
error_reporting(E_ALL);
PS. You first need to make sure your browser didn't display friendly error.
Reply With Quote
  #5  
Old 19-01-2009
Member
 
Join Date: Oct 2008
Posts: 37
Re: Error reporting levels in PHP

Hey Zecho, that was a great work. I was searching for such a list of PHP error reporting. And I have checked that my browser is not giving any friendly error. Thank you and all others for giving valuable inputs.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Error reporting levels in PHP"
Thread Thread Starter Forum Replies Last Post
How to make Windows 7 free from error reporting? Sheena_thakkar Operating Systems 5 22-12-2009 10:46 PM
Error reporting in PHP and drawback Soft Pack Software Development 3 16-01-2009 01:20 PM
Disable Error Reporting in Windows XP Conrad Tips & Tweaks 0 17-11-2008 12:52 PM
Problem with Error Reporting In Windows XP Dwight Operating Systems 2 04-11-2008 06:23 PM
.net runtime 2.0 error reporting - error id 1000 sevaanan Small Business Server 1 22-02-2008 09:41 PM


All times are GMT +5.5. The time now is 09:33 PM.