php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49627 error_log to specified file does not log time according to date.timezone
Submitted: 2009-09-22 17:16 UTC Modified: 2009-10-05 13:57 UTC
From: mp at icomme dot fr Assigned: dmitry (profile)
Status: Closed Package: Date/time related
PHP Version: 5.2.11 OS: FreeBSD 7.2
Private report: No CVE-ID: None
 [2009-09-22 17:16 UTC] mp at icomme dot fr
Description:
------------
When php.ini is configured with "error_log" to a specified file (not via syslog), PHP does not log date and time of records (errors, warnings, etc.) according to the "date.timezone" configured in php.ini, it's always recorded with GMT time.
PHP (5.2.6) used to work correctly with this.

OS and PHP have correct time zone :

$ date
Tue Sep 22 19:05:32 CEST 2009
... time on OS is correctly configured : CEST = GMT+2

print date('r T');
print gmdate('r T');
... respectivly returns :
Tue, 22 Sep 2009 19:06:12 +0200 CEST
Tue, 22 Sep 2009 17:06:12 +0000 GMT
... PHP correctly configured

Box :
FreeBSD 7.2-RELEASE (GENERIC)
Apache/2.2.13 (Unix)
PHP 5.2.11

Someone says (bug 45191) this bug has been fixed in CVS on May 2009, but 2 versions of the 5.2 branch had been released since this date, and the bug is still present.


Reproduce code:
---------------
# php.ini :
; Log errors to specified file.
error_log = "/var/log/php/php-error.log"
; Defines the default timezone used by the date functions
date.timezone = "Europe/Paris"

# test.php :
nonexistantfunction();



Expected result:
----------------
[22-Sep-2009 18:57:55] PHP Fatal error:  Call to undefined function nonexistantfunction() in /usr/home/michel/public_html/plante.php on line 9

Actual result:
--------------
[22-Sep-2009 16:57:55] PHP Fatal error:  Call to undefined function nonexistantfunction() in /usr/home/michel/public_html/plante.php on line 9

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-22 20:37 UTC] jani@php.net
This was fixed in bug #45191 but that fix caused crashes in certain 
cases (f.e. bug #48247) and was essentially reverted it seems. Now I can 
not reproduce that crash bug anymore even when I revert my change. 
Dmitry, how did you make it crash again? :)
 [2009-10-05 13:56 UTC] svn@php.net
Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=289214
Log: Fixed bug #49627 (error_log to specified file does not log time according to date.timezone)
 [2009-10-05 13:57 UTC] dmitry@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2009-10-09 19:06 UTC] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=289442
Log: - Merge: Fixed bug #49627 (error_log to specified file does not log time according to date.timezone)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC