tomjung

Member
Jul 21, 2014
8
0
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
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.
 

tomjung

Member
Jul 21, 2014
8
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
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.
 

tomjung

Member
Jul 21, 2014
8
0
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I am happy to see the issue has been addressed. Thank you for updating us with the outcome.