The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Showing errors on page instead of logging to error_log

Discussion in 'General Discussion' started by Technus007, Jan 2, 2010.

  1. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Hello!

    Some of my customers have an error_log file inside their /public_html directory with PHP errors logged.

    How can I make those PHP errors to be displayed directly on the page (when viewing the page with the error thru browser), instead of logging them into error_log file?

    Thanks!
     
  2. InstaCarma_Tech

    InstaCarma_Tech Well-Known Member

    Joined:
    Apr 22, 2009
    Messages:
    228
    Likes Received:
    1
    Trophy Points:
    18
    Put the following in the htaccess file in the public_html folder for the account :
    Code:
    php_flag display_errors on
    Or modify/create a custom php.ini in the folder and put the following in it:
    Code:
    display_errors = on
     
  3. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your reply!

    The main reason of my problem is that I already have display_errors On in my PHP configuration (php.ini).

    Here's PHPINFO for reference... phpinfo()
     
  4. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Move the phpinfo file under the domain in question and see if display_errors is ON for the domain. Also you can enable display_errors for a single file by adding the following line at the top of the file

     
  5. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    The phpinfo within that domain is showing me the same display_errors ON.
    By the way, the file error_log that creates automatically in the user directories, is it logging all the PHP errors that been encountered during PHP page (code) loading, or it's logging only some kind of PHP errors, those, that are not displayed on the PHP page via browser while code loading?

    Thanks!
     
    #5 Technus007, Jan 3, 2010
    Last edited: Jan 4, 2010
Loading...

Share This Page