Skip to main content

date.timezone incorrect in error logs

Comments

7 comments

  • cPanelMichael
    Hi @4u123, I was unable to reproduce the behavior you described on a test server when taking the following steps: 1. Review the system time: # date Wed Aug 15 10:42:27 CDT 2018
    2. Set the "date.timezone" php.ini directive using WHM >> MultiPHP INI Editor to "America/New_York" for PHP version 7.0. 3. Uploaded and accessed a test PHP script that errors out on a domain using PHP version 7.0. 4. Confirmed the error_log file uses the configured time zone: [15-Aug-2018 11:44:31 America/New_York] PHP Parse error:
    Can you verify which PHP handlers are assigned to the accounts you are testing this with? Thank you.
    0
  • 4u123
    All servers are using lsapi
    0
  • 4u123
    No we've been using EA4 for some time now. We did previously use cl.selector but this is disabled when removing alt-php. It's also important to mention that since switching to EA4 and setting the date.timezone - the error logs have been producing entries with the correct timezone until recently. Only regular EA4 / cpanel updates can have had an influence on this situation. Nothing else has changed. I also note that there have been significant changes to the EA4 PHP configuration in recent cpanel versions. I'd be interested to know under what circumstances the timezone in an error_log can be different to that of the PHP environment. I've done some research but so far not found anything. I'll keep digging.
    0
  • cPanelMichael
    Hello @4u123, I'm happy to take a deeper look as well, but I'll need some additional information about how the affected system is configured. You noted using LSAPI as the PHP handler for the EA-PHP packages. I've setup a system with that configuration, however by default it logs the PHP errors to /usr/local/apache/logs/error_log. EX: [Tue Aug 21 10:55:22.477458 2018] [lsapi:error] [pid 15311:tid 139887705560832] [client 1.2.3.4:59417] [host domain.tld] Backend fatal error: PHP Fatal error: Cannot divide by zero in /home/username/public_html/test.php on line 3\n
    Can you let me know of any specific changes you've made to the PHP configuration on the affected system (as it relates to PHP error logging or otherwise) so that I can replicate the issue? Thank you.
    0
  • 4u123
    I appreciate you taking the time to do that. We haven't done anything special. All PHP errors produced by scripts in customer accounts are saved to a file named error_log at the location of wherever the script was running from in the users home directory. That's the default behaviour and has been for at least a decade as far as I know. We haven't done anything to force that. The error log you mention is the Apache log and for as long as we have been using cpanel - PHP errors have never been logged into that file.
    0
  • cPanelMichael
    Hi @4u123, It looks like the global Apache error log was utilized for PHP error logging on my test system because mod_suexec was not installed (PHP was running as the Apache user). I installed it (yum install ea-apache24-mod_suexec) and now PHP errors are logged to the individual error_log files within the document root of the PHP script. With that issue solved, I utilized the steps referenced in my if you'd like for us to investigate further. Thank you.
    0

Please sign in to leave a comment.