SitePoint Sponsor

User Tag List

Results 1 to 19 of 19
  1. #1
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Php page produces no Error messages!

    Hello,

    Our Php pages on a new server that we have moved on are producing NO Erroe messages!
    Worse still even if I add a, for debugging:
    echo 'Hello World 0<p>';
    it does not even print that out.
    That is the page loads with completely nothing in it. But a digit 1 on the upper left corner!
    How do we tell the Php on this news server to output error messages?

    Thank you.

    Anoox search engine volunteer

    www.anoox.com

  2. #2
    SitePoint Zealot 2ndmouse's Avatar
    Join Date
    Jan 2007
    Location
    West London
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out php_info()

    E.G.

    PHP Code:
    <?php

    // Show all information, defaults to INFO_ALL
    phpinfo();
    ?>
    Create a file, upload it and run it - if PHP is active, it will display current config
    Detect file changes remotely. SimpleSiteAudit is an early
    warning anti-hacker system which sends an alert on detection.

    PHP Find Orphan Files - Finds all the unreferenced files on your site.

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,747
    Mentioned
    65 Post(s)
    Tagged
    0 Thread(s)
    Have you followed the instructions in Common-PHP-Problems?
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  4. #4
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    Yes, I did that.
    So what are we looking for?
    What should we be changing to display Error messages to the browser as they occur?

    ThanX,

    Anoox search engine volunteer

    www.anoox.com

  5. #5
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I also added the code:

    ini_set('display_errors',1);
    error_reporting(E_ALL);

    just to see. But the Php page still comes back totally Blank!

    Really amazing how strange stuff can pop up on a new server!

    Anoox search engine volunteer

    www.anoox.com

  6. #6
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    2ndmouse,

    Just to let you know I did a test but just removing a ; from a line of a Php page and the whole page
    is displayed blank without any Error messages.
    So the problem is for sure with the Php.ini of the new server that results in it displaying no Php Error
    messages but displays a blank page.

    Even if you add this code:

    ini_set('display_errors',1);
    error_reporting(E_ALL)

    it still prints no Php Error messages! Which is death when it comes to Php programming

    So do you all know which Php.ini setting we need to change to enable Php error messages to be displayed?

    ThanX.

    Anoox search engine volunteer

    www.anoox.com

  7. #7
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,580
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Can you copy and paste your script inside and supply a link to the offending page.

  8. #8
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It is any page that has any error in it, shows up totally blank.
    That is as I said I took a Php page that is working fine, and just removed a ; from one of the lines, and then
    it shows up as Blank too.

    Anoox search engine volunteer

    www.anoox.com

  9. #9
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    2ndmouse,

    So you have any ideas as to what we need to do to enable Php Error reporting on our new sever?

    Again, a Php page with any error, will display as a totally Blank page rather than reporting the Error in that page.
    And I mean any Error, as simple as leaving off a ; or whatever results in a totally Blank page being returned by the server.

    BTW, I did enable this in Php.ini

    display_errors = stdout

    and also added all these commands to a given Php page:

    ini_set('display_errors',1);
    ini_set('display_startup_errors',1);
    error_reporting(-1);

    To no result

    Thank you all.
    I am at wits end here




    Quote Originally Posted by 2ndmouse View Post
    Check out php_info()
    E.G.

    PHP Code:
    <?php

    // Show all information, defaults to INFO_ALL
    phpinfo();
    ?>
    Create a file, upload it and run it - if PHP is active, it will display current config

    Anoox search engine volunteer

    www.anoox.com

  10. #10
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,910
    Mentioned
    96 Post(s)
    Tagged
    0 Thread(s)
    Did you remember to restart the server after making the changes to phi.ini ?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  11. #11
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,580
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    I have had this error with CodeIgniter and had to use echo __LINE__; die; to trace the flow and chase the errors.

    Check the php_error log file, it should have lots of entries

  12. #12
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,910
    Mentioned
    96 Post(s)
    Tagged
    0 Thread(s)
    What version of PHP are you using (what is reported by each "level" of error reporting varies a bit between versions of php
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  13. #13
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    SpacePhoenix,

    Yes, I did re-start Apache after the change to the Php.ini file.

    Quote Originally Posted by SpacePhoenix View Post
    Did you remember to restart the server after making the changes to phi.ini ?

    Anoox search engine volunteer

    www.anoox.com

  14. #14
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    And it is PHP Version 5.3.3

    But again it is NOT reporting any Error at all.
    Even the simplest Errors are causing a Blank page to be returned!!!
    So there is something strange (wrong) somewhere that is causing on this NEW server all of a
    sudden Php pages to come back Blank when any error occurs!

    So what to do?

    Anoox search engine volunteer

    www.anoox.com

  15. #15
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,580
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by WorldNews View Post
    And it is PHP Version 5.3.3

    But again it is NOT reporting any Error at all.
    Even the simplest Errors are causing a Blank page to be returned!!!
    So there is something strange (wrong) somewhere that is causing on this NEW server all of a
    sudden Php pages to come back Blank when any error occurs!

    So what to do?
    Try inserting this on the page that you are calling:
    PHP Code:

    <?php 
      
    echo "Hello World";  die;
    If that works then I think you have a syntax error on the page and you will have to step through until you find the syntax error.

    Best to do it by moving the die; halfway down the page:

    1. if does not work work then move the die; halfway up

    2. if does work work then move the die; halfway down again

    3. repeat until you find the syntax error

  16. #16
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,910
    Mentioned
    96 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by WorldNews View Post
    ini_set('display_errors',1);
    error_reporting(E_ALL)
    Try swapping around the order of them two lines
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  17. #17
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    SpacePhoenix, I swapped the 2 lines, that is now have at the top of the Page:

    error_reporting(E_ALL);
    ini_set('display_errors',1);

    And still nothing. That is again page comes back totally blank!
    Amazing
    You would thing something this basic and essential that is error reporting on a Php page would not take
    4 days to enable




    Quote Originally Posted by SpacePhoenix View Post
    Try swapping around the order of them two lines

    Anoox search engine volunteer

    www.anoox.com

  18. #18
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,910
    Mentioned
    96 Post(s)
    Tagged
    0 Thread(s)
    As it stands what are the current values for the following when you view the output of phpinfo()

    * display_errors
    * error_reporting

    [QUOTE]error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR);/QUOTE]

    That's what I personally use for setting the error reporting
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  19. #19
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,027
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Just wanted to let you know that I finally resolved this.
    The problem was due to
    error_reporting
    appearing TWICE in Php.ini file.
    So the 2nd instance value was over riding the 1st instance which I had updated!



    [QUOTE=SpacePhoenix;5317276]As it stands what are the current values for the following when you view the output of phpinfo()
    * display_errors
    * error_reporting

    error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR);/QUOTE]

    That's what I personally use for setting the error reporting

    Anoox search engine volunteer

    www.anoox.com


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
  •