Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 12 of 12

This is a discussion on error logs in the VPS & Dedicated forum
I've been trying to get an error log of php &mysql errors to be written in each indiviual hosting accounts www root (or where ever ...

  1. #1
    articlefriendly.com
    Join Date
    Aug 2007
    Location
    Seattle
    Posts
    30

    Question error logs

    I've been trying to get an error log of php &mysql errors to be written in each indiviual hosting accounts www root (or where ever the errror occured), but seem to have run up against a big, white page wall. All I get is the infamous blank white page, and no debug info anywhere that I can find.

    Anybody happen to know what needs to be set to have an error log created automatically in individual accounts?

    Thanks in advance,

    Jan

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Just turn the error display on in your .ini file, and debug it...

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Error handling and logging ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ; error_reporting is a bit-field.  Or each number up to get desired error
    ; reporting level
    ; E_ALL             - All errors and warnings
    ; E_ERROR           - fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it's automatically initialized to an
    ;                     empty string)
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ;
    ; Examples:
    ;
    ;   - Show all errors, except for notices
    ;
    ;error_reporting = E_ALL & ~E_NOTICE
    ;
    ;   - Show only errors
    ;
    ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
    ;
    ;   - Show all errors except for notices
    ;
    error_reporting  =  E_ALL & ~E_NOTICE
    
    ; Print out errors (as a part of the output).  For production web sites,
    ; you're strongly encouraged to turn this feature off, and use error logging
    ; instead (see below).  Keeping display_errors enabled on a production web site
    ; may reveal security information to end users, such as file paths on your Web
    ; server, your database schema or other information.
    display_errors = On
    Um...

    Then turn it off when you're done...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    articlefriendly.com
    Join Date
    Aug 2007
    Location
    Seattle
    Posts
    30

    Red face ummm .. did that ...

    My bad .. should have mentioned I already did that. Had the display errors setting set to off in php.ini, but I started back to work on writing more code, so I set it back to "on" ... restated the ded server, but no errors are being displayed on the page or in the cpanel error log. Also, no error_log is created in the user's directory (which is what I really want to happen!)

    I also tried, error_reporting(E_ALL) and set the error logging on with a php_flag .. still nothing. would be no big deal normally as I'd just go over every line of code until I found what I forgot (usually a ; or a bracket), but I'm working on a big block of code, so having an error log show up in the home directory would be reallllllly helpful

    Thanks for your help Vin,

    Jan

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Hrm...

    If you're running cPanel, you can always check the error log there.

    That's usually what I do...

    Double Hrm...

    This is an odd one!
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Wait a minute...

    You're *probably* running PHP as an Apache mod.

    Have you tried...

    Code:
    php_flag display_errors on
    in your .htaccess file?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  6. #6
    articlefriendly.com
    Join Date
    Aug 2007
    Location
    Seattle
    Posts
    30
    Yes, as mentioned above I tried that. Due to being old and nearly senile, I also rechecked to make sure I had actually set the display errors back to "on" in my php.ini, but I actually did, so it's not that either...
    I though about using the cpanel error log but it's not showing any php or mysql errors. When I run the page with an error on it, all that shows in the cpanel log is that I tried to access it and got a 200 code...
    Whm raw logs show the same thing basically ... I'm pretty sure if I hadn't had so much fun back in the 60's - 70's I'd probably have a clue, but right now I've run out of ideas.

    I certainly appreciate your thoughts on the problem Vin I think I'll dig up a quick custom error handler and see if I can at least get the server to email me the errors ..

    best,

    Jan

  7. #7
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,312
    Did you create and point a browser at a file with just
    PHP Code:
    <?php
     phpinfo
    ();
    ?>
    in the same directory as the script to ensure you're picking up the .ini file you think you are?
    Good luck

  8. #8
    articlefriendly.com
    Join Date
    Aug 2007
    Location
    Seattle
    Posts
    30

    Triple Hmmm ....

    good question .. knowing me, that could happen

    I'll check that now ...

    best,

    Jan

  9. #9
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Also make sure that your error_reporting setting is sent to *something*, if a failure occurs that stops execution, but you don't have error reporting turned on for that level of error then you'll see the white page regardless of your display_errors setting.

    php_value error_reporting E_ALL
    php_value error_reporting E_ALL ^E_NOTICE
    etc.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  10. #10
    articlefriendly.com
    Join Date
    Aug 2007
    Location
    Seattle
    Posts
    30
    Thank you jason, I appreciate your post, but I have set the error_reporting(E_ALL) directly in the pages I'm working on and it's turned on in php.ini ... I've been programming/debugging in php/mysql for a few years now, but this the first time I've run into error reporting not working even tho set in the server or directly thru the script.
    Weird, but even my custom error handler isn't giving me anything. Got to be a setting somewhere I've missed, so back to the search!

    Thanks again,

    Jan

  11. #11
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,312
    Just a couple more thoughts...

    Maybe check to see that you're not getting a 500 error and the script just isn't running at all?

    Did you have any luck with the phpinfo()-only file? (I neglected to mention to make it a .php extension file, but I figured you'd figure that out. )

    Maybe you're hitting an "exit;" line somewhere?
    Good luck

  12. #12
    articlefriendly.com
    Join Date
    Aug 2007
    Location
    Seattle
    Posts
    30
    Good thinking on the exit; .... I use several die; statements so that could be the issue on the ded server, but I moved development of the script to one of my vps's and it's working fine, so I think I'll just work on it there

    The ded server has been a pain since I got it, so I just canceled it, and I'll just work from vps's from now on ...

    Thanks for you thoughts,

    Jan

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
  •