SOLVED Replaced error log not populating

ca2236

Well-Known Member
Feb 2, 2018
199
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hello,

I had an error log that was quite large, so I manually replaced it and created a new one. I'm certain I did something wrong, as no output is being written to it now.

Is there a way to get this working again?

This would be the error_log in the doc root directory (public_html in our case)

Thanks
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
Hi @ca2236

Are you sure the log was currently being written to? You may also need to ensure that php error logging is enabled in the php.ini for that version of PHP. You can make modifications to this from WHM>>Software>>MultiPHP INI Manager
 

ca2236

Well-Known Member
Feb 2, 2018
199
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hi

Thank you for taking the time to write back. The log was definitely being written to before I moved it. Other than display_errors (which is disabled), I do not see anything for error logging under MultiPHP INI Manager.

I did just now correct file permissions, but nothing that would cause it not to write. (user always had rw)
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
Hi @ca2236


Ownership of the file is the user's UID/GID? Also you'd need to modify the lines as follows:


Code:
; Log errors to specified file. PHP's default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
;error_log = php_errors.log
; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog
error_log = error_log
Code:
; Besides displaying errors, PHP can also log errors to locations such as a
; server-specific log, STDERR, or a location specified by the error_log
; directive found below. While errors should not be displayed on productions
; servers they should still be monitored and logging is a great way to do that.
; Default Value: Off
; Development Value: On
; Production Value: On
; http://php.net/log-errors
log_errors = On
In the editor mode of the PHP version. If you're running PHP-FPM errors will not be logged here by default, they will be logged to
Code:
/home/$user/log/domain_tld.php.error.log
Thanks!
 

ca2236

Well-Known Member
Feb 2, 2018
199
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hi @cPanelLauren

I didn't have any of that in my php.ini. So I added log_errors=on and error_log = error_log.

the error log is owned by the same user/group as the rest of the directory. There is still no output into it.

I do not think I'm running php-fpm as I don't have the logs mentioned and ps aux | grep php-fpm returns nothing.

Here is the content of my php.ini file

cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (PHP Home - EasyApache 4 - cPanel Documentation)

display_errors = Off
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 128M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php71"
upload_max_filesize = 2M
zlib.output_compression = Off
error_log= error_log
log_errors=on
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
Hi @ca2236


This is the user's php.ini can you check the php.ini through WHM as I indicated previously - WHM>>Software>>MultiPHP INI Manager -> PHP 7.1 -> Editor mode

Is it also possible that there aren't current errors for the domain in question?

Thanks!
 

ca2236

Well-Known Member
Feb 2, 2018
199
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hi @cPanelLauren

You are correct, I apologize. I checked the location it and it shows the error_log = error_log and log_errors= on for the version of php the site is running.

since the cpanel module errors (under metrics) is blank and the public_html/error_log is blank. I was trying to look around and find errors from various logs taken from

The cPanel Log Files - cPanel Knowledge Base - cPanel Documentation

I'm not finding, so far, any error about not writing to error_log. If you can help with a specific location to look, I would gladly take the advice, I'm still new to cpanel. :)

I did find an interesting error I wanted to ask about. Can you tell me what this means?
Timeout waiting for output from CGI script /usr/local/cpanel/cgi-sys/ea-php71, referer: http://www.domain.com/wp-cron.php?doing_wp_cron=<cron id here> ..

If you specifically need the cron id. Let me know. I do not know if it is OK to post or not.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
Hi @ca2236

I just want to confirm how you are testing that there aren't any errors and to make sure you are looking for PHP specific errors, as that is all that will be logged to that specific error log. It won't repopulate until there are PHP errors to log.

Timeout waiting for output from CGI script /usr/local/cpanel/cgi-sys/ea-php71, referer: http://www.domain.com/wp-cron.php?doing_wp_cron=<cron id here> ..
Without further information, it's hard to tell beyond what the error indicates. You might check the apache error log at
Code:
/etc/apache2/logs/error_log
If you need further assistance with that specifically though I'd recommend opening a separate thread so it can get the attention it deserves.

Thanks!
 

ca2236

Well-Known Member
Feb 2, 2018
199
22
18
Nebraska
cPanel Access Level
DataCenter Provider
hi @cPanelLauren

I want to verify that I understand correctly with public_html\error_log. You are saying that it will be empty if there is nothing to write? That makes sense, but I guess I was having a hard time accepting something wasn't wrong due to the previous file.

I will go ahead and open a new ticket for the wp-cron timeout question.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
I want to verify that I understand correctly with public_html\error_log. You are saying that it will be empty if there is nothing to write? That makes sense, but I guess I was having a hard time accepting something wasn't wrong due to the previous file.
Yes, exactly, that error may be written to the Apache error logs separately from the PHP logs.

I will go ahead and open a new ticket for the wp-cron timeout question.
Sounds good!

Thanks!