Edit report at https://bugs.php.net/bug.php?id=45191&edit=1
ID: 45191 Comment by: bram at ebskamp dot me Reported by: info at organicdata dot co dot za Summary: error_log ignores date.timezone php.ini val when setting logging timestamps Status: Closed Type: Bug Package: Date/time related Operating System: Centos el5 PHP Version: 5.2CVS-2008-06-05 (snap) Assigned To: derick Block user comment: N Private report: N New Comment: Same problem here with PHP 5.4.3. Previous Comments: ------------------------------------------------------------------------ [2012-05-30 07:32:57] rohgeo at gmail dot com php 5.4.3 all messages in /var/log/php_errors.log have UTC timestamps. ------------------------------------------------------------------------ [2012-05-03 14:37:16] php at sboxx dot org Red Hat Entrprise Linux 6.2 PHP 5.4.1 date.timezone = Europe/Berlin log_errors = On error_log = /var/log/php_errors.log All messages in /var/log/php_errors.log have UTC timestamps. System time is set and correctly displayed as CET/CEST. ------------------------------------------------------------------------ [2012-02-12 09:56:41] wadkar at gmail dot com @christopher Interesting observation. My report is with 5.3.8 version, which outputs the log with UTC timestamp (the timezone is part of it). I am getting a feeling that this might not be a direct issue with php-src but somewhere in between system calls made by php-src for logging and the OS itself which passes on TZ data for this call. ------------------------------------------------------------------------ [2012-02-11 18:15:29] christopher at specialtyproduce dot com It seems this bug may have reappeared between 5.3.8 and 5.3.9? I have two MS 2008 R2 VMs, built from the same starting images. Both running IIS 7.5, system timezone is set for "Pacific Standard Time" and the TZ environment variable is not set. Machine A : PHP 5.3.8 (cli) (built: Aug 23 2011 12:14:39) (Originally configured with PHP 5.2.17 and subsequently upgraded to 5.3.8) Machine B : PHP 5.3.9 (cli) (built: Jan 10 2012 16:33:06) Their php.ini files are virtually identical, with: log_errors = On date.timezone=America/Los_Angeles error_log="C:\PHP\logs\php53_errors.log" I ran a version of the "mycode.php" from the original bug report on both machines. mycode.php ---------- FIRSTBADCONSTANT; date_default_timezone_set("UTC"); SOMEBADCONSTANT; date_default_timezone_set("America/Los_Angeles"); ANOTHERBADCONSTANT; Machine A php53_errors.log -------------------------- [11-Feb-2012 09:39:18] PHP Notice: Use of undefined constant FIRSTBADCONSTANT - assumed 'FIRSTBADCONSTANT' in C:\Temp\mycode.php on line 2 [11-Feb-2012 17:39:18] PHP Notice: Use of undefined constant SOMEBADCONSTANT - assumed 'SOMEBADCONSTANT' in C:\Temp\mycode.php on line 4 [11-Feb-2012 09:39:18] PHP Notice: Use of undefined constant ANOTHERBADCONSTANT - assumed 'ANOTHERBADCONSTANT' in C:\Temp\mycode.php on line 6 Machine B php53_errors.log -------------------------- [11-Feb-2012 18:06:52 UTC] PHP Notice: Use of undefined constant FIRSTBADCONSTANT - assumed 'FIRSTBADCONSTANT' in C:\Temp\mycode.php on line 2 [11-Feb-2012 18:06:52 UTC] PHP Notice: Use of undefined constant SOMEBADCONSTANT - assumed 'SOMEBADCONSTANT' in C:\Temp\mycode.php on line 4 [11-Feb-2012 18:06:52 UTC] PHP Notice: Use of undefined constant ANOTHERBADCONSTANT - assumed 'ANOTHERBADCONSTANT' in C:\Temp\mycode.php on line 6 The 5.3.9 error reporting seems locked in UTC. ------------------------------------------------------------------------ [2012-02-09 23:21:35] daniel dot caillibaud at sesamath dot net In an openvz VM, with php-fpm 5.3.10 (debian squeeze OS), with a sytem date configured on UTC+1 (on physical host, but `date` in VM also show UTC+1), in php.ini I've a date.timezone = "Europe/Paris" but php error_log date is displayed as UTC [09-Feb-2012 23:15:08 UTC] PHP Notice: ... while all others logs are in the system timezone, e.g nginx [10/Feb/2012:00:16:46 +0100] ... and syslog as well is UTC+1 (but doesn't show it on each log line). Hope it helps... ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=45191 -- Edit this bug report at https://bugs.php.net/bug.php?id=45191&edit=1