php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49721 date_default_timezone_get not query the OS correctly
Submitted: 2009-09-30 13:23 UTC Modified: 2009-09-30 13:56 UTC
From: nick dot cooper at jdi-solutions dot co dot uk Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.3.0 OS: Windows Server 2003 R2 SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nick dot cooper at jdi-solutions dot co dot uk
New email:
PHP Version: OS:

 

 [2009-09-30 13:23 UTC] nick dot cooper at jdi-solutions dot co dot uk
Description:
------------
An issue with how date_default_timezone_get() is querying the host 
operating system for timezone information under Windows server 2003.



Reproduce code:
---------------
I started by experiencing an issue with strtotime(). 

<?php
echo strtotime("10 September 2009");
?>

When running under 'Apache/2.2.11 (Win32) mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.3.0' it restarts.

I switched back to 5.2.9-2 and ran the same script without issue.

This test was carried out on Window Server 2003 R2 SP2

I then performed the exact same test on XP SP3 with the same Apache/PHP setup, there was no issue.

I figured it must be something to do with the way PHP gets the timezone information.

Again under PHP5.3 on Server 2003 I tried the following: date_default_timezone_get() and Apache restarted.

I altered the PHP.ini to include the date.timezone setting and tried again and there was no issue.

The issue must therefore be with how date_default_timezone_get() is querying the host operating system for timezone information.

Expected result:
----------------
Display timestamp

Actual result:
--------------
Apache unexpectedly restarts:

[Wed Sep 30 13:51:50 2009] [notice] Parent: child process exited with 
status 128 -- Restarting.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-30 13:28 UTC] pajoye@php.net
The issue has been fixed already. However you have to set the default timezone in php.ini, always.
 [2009-09-30 13:40 UTC] nick dot cooper at jdi-solutions dot co dot uk
From reading the PHP documentation it suggests the setting is optional:

3) Reading the value of the date.timezone ini option (if set)

4) Querying the host operating system (if supported and allowed by the 
OS)

Or otherwise fullback 4 would never be called. If it has become required 
in PHP5.3.0 since PHP5.2.9 should this not be mentioned in the 
documentation?

What is the bug number where the issue has been fixed?

Thank you
 [2009-09-30 13:45 UTC] pajoye@php.net
It is not optional (unless you want to have dozen of warnings). I don't have the bug # at hand, it was about a crash when this setting was not set.
 [2009-09-30 13:56 UTC] nick dot cooper at jdi-solutions dot co dot uk
Since most people have warning switched off the issue is likely to go 
unseen. 

Also the default production ini has the setting commented out, I can 
understand why since we all live in different timezones.

If the issue has already been resolved will it be included in 5.3.1?

Thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 18:01:30 2024 UTC