How can i turn on php error reporting just for a sub-domain

Discussion in 'HTML & Website Design' started by swiminsoda, Aug 24, 2011.

  1. #1
    I'm trying to make some changes on my website, but I don't want to turn on error reporting globally.Is there any way to do so just for sub-domain?
     
    swiminsoda, Aug 24, 2011 IP
  2. Junioreality

    Junioreality Active Member

    Messages:
    158
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    You can do it for any file you want to debug, by putting this line at the very top of your page (before <!doctype...)
    <?php
    error_reporting(E_ALL);
    ?>
    <!doctype...
    To do NOT report errors, use "error_reporting(0);"
    For other values, check "error_reporting" function at www.php.net

    Actually, I leave error_reporting(E_ALL) on ALL my files, on ALL my sites! This forces me to make clean code, free of any errors.
     
    Junioreality, Aug 24, 2011 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    You can also use FirePHP when you're debugging PHP code. (I won't use a computer or work on a site without it. It's like telling a carpenter to pound in nails with his fist.)
     
    Rukbat, Aug 24, 2011 IP
  4. swiminsoda

    swiminsoda Member

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Thanks for the useful advise.
     
    swiminsoda, Aug 31, 2011 IP
  5. swiminsoda

    swiminsoda Member

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    Thanks for the advise! That works fine.
     
    swiminsoda, Aug 31, 2011 IP
  6. swiminsoda

    swiminsoda Member

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #6
    I'll look into it. Thanks.
     
    swiminsoda, Aug 31, 2011 IP