Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts

    My error reporting isn't working

    I start off my code with this:

    PHP Code:
    ini_set ("display_errors""1");
    error_reporting(E_ALL); 
    But despite that, when I get an error all I get is a blank screen

    This started happening yesterday and I can't figure out why !




    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,337
    Thanks
    13
    Thanked 348 Times in 344 Posts
    maybe you have a fatal error …
    Quote Originally Posted by php.net
    display_errors string

    This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user.

    Value "stderr" sends the errors to stderr instead of stdout. The value is available as of PHP 5.2.4. In earlier versions, this directive was of type boolean.

    Note: Although display_errors may be set at runtime (with ini_set()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    But if I have a fatal error would I not get a server error
    rather than a blank html page ?

    EDIT:

    I just checked my server log and it IS a normal parse error:

    PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/coachman/public_html/coaching1.php on line 76

    So I don't know why it isn't being sent to the page !



    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,337
    Thanks
    13
    Thanked 348 Times in 344 Posts
    not necessarily, a fatal error like E_ERROR just terminates your script (it’s not an error that makes PHP crash), leaving the server unaffected. how PHP handles that, depends on its settings. it can well be that you don’t get visual output with fatal errors.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #5
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Possibly I did my edit after you
    replied :


    I just checked my server log and it IS a normal parse error:

    PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/coachman/public_html/coaching1.php on line 76

    So I don't know why it isn't being sent to the page !




    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #6
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,337
    Thanks
    13
    Thanked 348 Times in 344 Posts
    Quote Originally Posted by jeddi View Post
    Possibly I did my edit after you replied
    definitely.

    what PHP version do you have?
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #7
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    php 5.2.9
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #8
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,337
    Thanks
    13
    Thanked 348 Times in 344 Posts
    may I point out again, that display_errors ain’t a boolean anymore?
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #9
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks,
    so what string should I place in here to make it
    display to screen ?

    PHP Code:
    ini_set ("display_errors""string"); 


    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #10
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    PHP Code:
    ini_set('display_errors''On');
    error_reporting(E_ALL); 
    better still, do this in a .htaccess file. Add
    Code:
    php_flag display_errors On
    php_value error_reporting 30719
    Note that it's not advised to do this on a production server, only the development server. If you have access to the php.ini do this directly changing error_reporting and display_errors in the php.ini file, then restarting your server
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #11
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you have root access, check if you have other php.ini in your system eg. /etc/php5/apache2filter/php.ini
    Make sure error reporting is turned on in those files as well.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •