Skip to main content

How to generate error log for failing php script

Comments

5 comments

  • cPanelMichael
    Hello :) What changes did you make to the /usr/local/lib/php.ini file? Make sure the "log_errors" value is "ON". Also, check to see if there is a php.ini file within the account's home directory that is taking precedence. Thank you.
    0
  • NetCaptive
    [quote="cPanelMichael, post: 1629872"> What changes did you make to the /usr/local/lib/php.ini file? Make sure the "log_errors" value is "ON". Also, check to see if there is a php.ini file within the account's home directory that is taking precedence.
    I had changed "log_errors = Off" to "log_errors = On" (for /usr/local/lib/php.ini) and it didn't seem to have any effect. Do i need to restart apache after each change? There's no php.ini in the account's home folder. I guess i'd rather do that, than turn on logging for everything. What's the best way to implement it, just a single line with "log_errors = On"?
    0
  • cPanelMichael
    Yes, restart Apache after making that change to the global php.ini file. You should copy the entire /usr/local/lib/php.ini file to the account's home directory rather than just creating the file with the single line. Thank you.
    0
  • NetCaptive
    Okay, i copied /usr/local/lib/php.ini to /home//php.ini. I edited the php.ini file with these changes (comments removed): error_reporting = E_ALL log_errors = On error_log = error_log
    That didn't work. So i tried adding the full path to the log: error_reporting = E_ALL log_errors = On error_log = /home//error_log
    Still no :( So i created the file error_log and chowned it to the account. Still nothing. To generate errors i'm using a sample found here: [url=http://us1.php.net/trigger_error]PHP: trigger_error - Manual Any tips on what i've done wrong? [COLOR="silver">- - - Updated - - - Worth mentioning -- Using the php.net error trigger, i do get an error in my browser.
    0
  • cPanelMichael
    What is the specific error message that you see in your browser? Thank you.
    0

Please sign in to leave a comment.