SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cant display errors

    Hello,

    I am trying to debug a script, but my webhost has disabled display_errors, I tried putting error_reporting(E_ALL); ini_set('display_errors', 1); at the top of my script, but it still displays a blank page, I am still new to php so I'm not sure what to try.

    -Adam

  2. #2
    SitePoint Zealot Ap0s7le's Avatar
    Join Date
    Jul 2003
    Location
    Lousiville, KY
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Adam, try checking in the error log for the server.

    Also some host have it setup to even create a "error_log" file in the same directory as the script that's running.

    Check that out, hope it helps.

    -Casey

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you have a parse error, your settings which you try to adjust in the script wont be applied, because the script never parses.

    you can try using a .htaccess file
    Code:
    php_flag display_errors on
    php_value error_reporting 2047

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Adam, try checking in the error log for the server.

    Also some host have it setup to even create a "error_log" file in the same directory as the script that's running.

    Check that out, hope it helps.

    -Casey
    How do I go about checkin the error log if there is not one if the same directory of the script?



    if you have a parse error, your settings which you try to adjust in the script wont be applied, because the script never parses.
    Ah that makes sense, but again how do I access/find .htaccess ?

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you create a file named .htaccess and put that code into it. upload to your doc root or whichever dir you want to apply the settings to.

    you may need to give it a temporary name like foo.htaccess until you ftp it to your webserver, then rename it to .htaccess

    you host may not allow the use of .htaccess file, or may not allow certain settings in .htaccess files. the easiest way to find out is to just try it, many hosts allow them.

    you might have an existing file, in which case just add that code to whatever is already in there.

  6. #6
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually, i just thought of another way.

    just make a new file, apply your error reporting settings, and then include() the file with the errors. it should work.

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok,
    Its working, I didnt realize you could just make a .htaccess file.

    Thanks for all the help clam!

    -Adam


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
  •