SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error Reporting.. still getting blank pages?

    Hey All.

    Something I have never been able to figure out is Error Reporting. Say for example you have an extra or missing curly brace, there should be some kind of error that is returned, instead I get a blank page.

    I put this at the top of my page:
    PHP Code:
    error_reporting(E_ALL);
    ini_set('display_errors''true'); 
    For display_errors I have trued using 'true' or '1' or 'yes' and it doesnt seem to do anything? What could the problem be?? Also, I notice that when people post examples the E_ALL is blue in color, when I do it on my server it is black, not sure if it is of any use or not.

  2. #2
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your error is a compile-time error (such as a missing curly brace), then your script errors out before your error_reporting and ini_set lines are executed - thus, you see nothing. To see these kinds of errors you must make the changes in php.ini or in .htaccess.
    PHP questions? RTFM
    MySQL questions? RTFM

  3. #3
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kromey View Post
    If your error is a compile-time error (such as a missing curly brace), then your script errors out before your error_reporting and ini_set lines are executed - thus, you see nothing. To see these kinds of errors you must make the changes in php.ini or in .htaccess.
    Ok, what do you edit? This isnt recommended is it, or is it safe?

  4. #4
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You edit the error reporting directives in php.ini. And no, this is not recommended for production machines, so you should only do it on your testing server. See http://www.php.net/manual/en/ini.php and the comments in your php.ini file itself.

    Also see http://www.php.net/manual/en/security.errors.php for why we don't want this on production machines.
    PHP questions? RTFM
    MySQL questions? RTFM


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
  •