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.

Logging Errors on Different Sites

Discussion in 'General Discussion' started by tomjung, Aug 13, 2014.

  1. tomjung

    tomjung Member

    Joined:
    Jul 21, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, I am new to Cpanel and having some issues with my error log.

    I have the WHM panel and Cpanel. I have two websites that are setup on dedicated IP addresses. DomainA and DomainB.

    DomainA on IPAddressA, I can login to my Cpanel, click on error log and everything looks good there.

    DomainB on IPAddressB is not showing the errors for that domain.

    I'm getting a 500 error on the page I'm working on so I know it should be logging the error. In my public_html folder I have my php.ini setup with these settings:

    ; 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 = off

    ; Even when display_errors is on, errors that occur during PHP's startup
    ; sequence are not displayed. It's strongly recommended to keep
    ; display_startup_errors off, except for when debugging.
    display_startup_errors = Off

    ; Log errors into a log file (server-specific log, stderr, or error_log (below))
    ; As stated above, you're strongly advised to use error logging in place of
    ; error displaying on production web sites.
    log_errors = On


    I also have a page setup (info.php) that has this code in it
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <?php 
    phpinfo(); ?>
    </body>
    </html>
    
    I get a 500 server error when going to that page. So I'm thinking it's a setting somewhere I missed but I don't know where to start looking.

    Any help is greatly appreciated!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,830
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You should see the "500" error message in the Apache error log:

    /usr/local/apache/logs/error_log

    Try uploading a PHP script that will produce a PHP error and see if it's logged to the error_log file within your account.

    Thank you.
     
  3. tomjung

    tomjung Member

    Joined:
    Jul 21, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi! Thanks for the reply!

    I ran the page that is throwing the error (cart.php) and then opened up the error_log as instructed. There is no 500 error message in there for the domain that I am working on. It has a few errors from my other domain though... Any idea why I'm not getting them from the domain I'm working on?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,830
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Right, a "500" error message is an Apache error, not a PHP error. What I am saying is that you should upload a script that generates a PHP error.

    PHP: trigger_error - Manual

    Thank you.
     
  5. tomjung

    tomjung Member

    Joined:
    Jul 21, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Oh! Got ya. That pointed me in the right direction. The only things that were showing in my log were:

    File does not exist:
    Directory index forbidden by Options directive:

    On my other sites it will log php syntax errors... even though I had log_errors on in my php.ini file, something else must have been messed up. I copied the php.ini from my working site over and it is logging the errors correctly now.

    Thanks for the help!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,830
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page