SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How do I see errors when a php page has problems?

    Here is the page I'm working on:

    http://www.oil-testimonials.com/newVersion/login.php

    Unless I've fixed the issue on my own, you should see a completely white page. Is there something I can do to turn on error reporting for php pages?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2008
    Location
    The Netherlands
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try ini_set('error_reporting',E_ALL);

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Greenville, South Carolina, United States
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As Rvan mentioned, or a more direct way (for only affecting the file you are working in), you could use

    PHP Code:
    error_reporting(E_ALL); 
    Note: This would go at the top of the file you are working on.
    Phase 8 Facebook Applications and Web Development

  4. #4
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,843
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by aalicki View Post
    As Rvan mentioned, or a more direct way (for only affecting the file you are working in), you could use

    PHP Code:
    error_reporting(E_ALL); 
    Note: This would go at the top of the file you are working on.
    If on the off-chance there are still no errors showing then try the following:

    PHP Code:
      
      ini_set
    'error_reporting',E_ALL );
      
    ini_set'display_errors'TRUE   ); 
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  5. #5
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    John_Betong, I tried your code suggestion and still no error page. I am running this website, for testing purposes, inside a directory off the root. Would that make a difference?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  6. #6
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,843
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    @busboy.

    Try copying and pasting this code at the very top of the test file:

    PHP Code:

      
    if( // 0 == FALSE, 1 == TRUE, 
      
    {
        
    # Defines
        
    defined('jj' )    ? NULL define'jj''<br />' );
        
    defined('D_DATE') ? NULL define('D_DATE',  date('d-m-Y'time()));
        
    defined('D_TIME') ? NULL define('D_TIME',  date('H:i:s'time()));
        
    defined('d_long') ? NULL define('d_long',  'l jS \of F Y h:i:s');
        
    defined('D_LONG') ? NULL define('D_LONG',  dated_long,  time()));
        

        
    # Dates   
        
    echo jj .ini_get('date.timezone');
        echo 
    jj .D_DATE;
        echo 
    jj .D_TIME;
        echo 
    jjD_LONG;
        echo 
    jj;  

        
    # File    
        
    echo jj__FILE__;
        echo 
    jj'Last modified: ' dated_longfilemtime(__FILE__) );
        echo 
    jj'filesize(): ' filesize__FILE__ ) . 'bytes';
        echo 
    jj;  

        
    # Test errors
        
    $x  = array();  
        
    $x[]= ini_set'error_reporting',-);  # -1 is most agressive
        
    $x[]= ini_set'display_errors',  );  #  1 == TRUE
        
        
    echo  jj  .__LINE__ ' : ' .$x[0];
        echo  
    jj  .__LINE__ ' : ' .$x[0];
        echo  
    jj  .__LINE__ ' : ' .$x[2];
        
        die;  
      } 
    Last edited by John_Betong; Apr 14, 2012 at 17:58. Reason: formatting and spelling: not my fortay
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  7. #7
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Still all I get is a blank white page. I wonder if this has anything to do with the fact that I use mod rewrite? Any other ideas?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  8. #8
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,843
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    How do I see errors when a php page has problems?
    Here is the page I'm working on:

    http://www.oil-testimonials.com/newVersion/login.php

    Unless I've fixed the issue on my own, you should see a completely white page. Is there something I can do to turn on error reporting for php pages?

    Thanks!
    Quote Originally Posted by busboy View Post
    Still all I get is a blank white page. I wonder if this has anything to do with the fact that I use mod rewrite? Any other ideas?

    Thanks!
    I checked the original link and it shows fine although there are a few minor HTML errors:

    http://validator.w3.org/check?uri=ht...Inline&group=0
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  9. #9
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I should have updated this thread, but instead of working inside a folder off the root, I decided to put the test project in a whole new domain. Here is the current page I'm working on that does not produce any error messages, even though I have copied and pasted in the various suggestions:

    http://www.e-downline.net/essential-oils.php?tID=7047

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  10. #10
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,414
    Mentioned
    81 Post(s)
    Tagged
    3 Thread(s)
    That page has a 500 error

  11. #11
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    How did you find that out? Why don't I get any text when errors are thrown? I used to, but now they don't show any more. Is it a setting in php.ini or something?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  12. #12
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,414
    Mentioned
    81 Post(s)
    Tagged
    3 Thread(s)
    I just clicked on your link - if you are still using mod rewrite what happens if you disable it?

  13. #13
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I deleted everything in the .htaccess file and then saved. Then I attempted to reload the page. I still get nothing but a blank white page.

    http://www.e-downline.net/essential-oils.php?tID=7047
    Convert your dollars into silver coins. www.convert2silver.com

  14. #14
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by busboy View Post
    How did you find that out? Why don't I get any text when errors are thrown? I used to, but now they don't show any more. Is it a setting in php.ini or something?

    Thanks!
    Could be. Take a look this article:
    http://www.communitymx.com/content/a....cfm?cid=26071

  15. #15
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Bless you tom8! I now have error reporting back on.
    Convert your dollars into silver coins. www.convert2silver.com

  16. #16
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm glad I could help out. You did question about that setting and I just provided the link.


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
  •