Bug 478568
Summary: | PHP defaults to incorrect timezone when system uses Australia/Brisbane | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Nigel Jones <dev> |
Component: | php | Assignee: | Joe Orton <jorton> |
Status: | CLOSED WONTFIX | QA Contact: | BaseOS QE <qe-baseos-auto> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 5.2 | ||
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-09-01 13:01:30 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Nigel Jones
2009-01-01 04:38:01 UTC
I'd also like to point out the function from the PHP Manual: http://us3.php.net/manual/en/function.date-default-timezone-get.php " In order of preference, this function returns the default timezone by: * Reading the timezone set using the date_default_timezone_set() function (if any) * Reading the TZ environment variable (if non empty) * Reading the value of the date.timezone ini option (if set) * Querying the host operating system (if supported and allowed by the OS) If none of the above succeed, date_default_timezone_get will return a default timezone of UTC. " It is obviously reaching the 4th point, but it is not getting the right timezone (is that method flawed?) See bug 469532 - this is fixed in Fedora 10. I'm not sure we could back port that solution to RHEL, though. (In reply to comment #2) > See bug 469532 - this is fixed in Fedora 10. I'm not sure we could back port > that solution to RHEL, though. Thanks for that note, I had not tested by reproducer under Fedora 10. I've tried 5.2.6-6 (which appears to have the fix you've mentioned) this does solve the problem. It would be very nice if the patch could be ported back. The fix for this used in Fedora was reverted due to breaking at least one PHP webapp. So, this bug is not really fixable, without breaking by-design behaviour of PHP: 1) It is not possible to reliably map from /etc/localtime to a canonical timezone name. 2) PHP, and/or applications based on PHP, needs to be able to determine a timezone name. So, the "correct" approach is to configure the timezone explicitly in /etc/php.ini. Regrettably, closing this bug. |