SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    development vs production error reporting

    I normally do:

    In Development:
    PHP Code:
    error_reporting(E_ALL);
    ini_set('display_errors'true); 
    In Production:
    PHP Code:
    error_reporting(0); 
    & use the
    PHP Code:
    set_error_handler() 
    to log errors

    Am i doing good, better or best or worse?

    Please suggest me.

  2. #2
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let me dig more.

    In production mode which is much more better:

    Simply
    PHP Code:
    error_reporting(0); 
    or

    PHP Code:
    error_reporting(E_ALL);
    ini_set('display_errors'false); 

  3. #3
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are the following three equivalents:

    PHP Code:
    ini_set('display_errors'true); 
    ini_set('display_errors''On');
    ini_set('display_errors'1); 

  4. #4
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I usually prefer to use this on production servers.

    error_reporting(0);
    Or disable it in php.ini.

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    display_errors = off
    log errors and keep error_reporting on(so you have something to log)

  6. #6
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey guru
    It is important to remember that the standard PHP error handler is completely bypassed. error_reporting() settings will have no effect
    guess from where it quoted


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
  •