Results 1 to 5 of 5

Thread: Error reporting levels in PHP

  1. #1
    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?

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    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

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    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


  4. #4
    Join Date
    May 2008
    Posts
    2,012

    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.

  5. #5
    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,475,644.54218 seconds with 16 queries