php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48882 "PHP Startup: Timezone database is corrupt"
Submitted: 2009-07-10 19:49 UTC Modified: 2009-07-18 01:00 UTC
Votes:23
Avg. Score:4.5 ± 0.7
Reproduced:22 of 22 (100.0%)
Same Version:15 (68.2%)
Same OS:11 (50.0%)
From: vonpreussen at 2secure dot us Assigned:
Status: No Feedback Package: Date/time related
PHP Version: 5.3.0 OS: centos 5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vonpreussen at 2secure dot us
New email:
PHP Version: OS:

 

 [2009-07-10 19:49 UTC] vonpreussen at 2secure dot us
Description:
------------
updated php and it now fails every time over timezone issue.
had latest tz data (tzdata-2009j) and back-stepped to 2009f and no change.

httpd error log (no php error logging is done even though it is turned on in /etc/php.ini) -- date.timezone = "UTC" and is ignored and the /etc/sysconf/clock file OR date_default_timezone_set() function (most likely, since removing the file gives the old system date) is used by php instead:

"PHP Warning:  PHP Startup: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in Unknown on line 0
"PHP Fatal error:  PHP Startup: Timezone database is corrupt - this should *never* happen! in Unknown on line 0"

/etc/localtime is a copy of the file for MDT and it shows up for OS time and nothing else.

googling reveals that this same error keeps popping up in new php versions as if the original tz scripts get re-used each time without any updating until the same problem emerges after release. then the patch is made and the original scripts remain unchanged.



Reproduce code:
---------------
core startup crash


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-10 21:31 UTC] derick@php.net
Did you compile PHP yourself?
 [2009-07-10 21:55 UTC] vonpreussen at 2secure dot us
no. yum install.
 [2009-07-18 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-08-06 16:50 UTC] bug dot odesk at gmail dot com
CentOS 5, php 5.3 cli. tzdata 2009i.

$ php -v
PHP Strict Standards:  PHP Startup: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in Unknown on line 0
PHP Fatal error:  PHP Startup: Timezone database is corrupt - this should *never* happen! in Unknown on line 0
Segmentation fault


strace log.

http://pastebin.com/f2b4d38c7
 [2009-08-06 17:05 UTC] bug dot dmca at gmail dot com
cli fixed after adding TZ=GMT in /etc/profile

apache module still not working.
 [2009-08-06 17:47 UTC] bug dot dmca at gmail dot com
apache module fixed by adding TZ=GMT in init.d script. Don't know if there any other way, but at least it's working.
 [2009-08-25 16:21 UTC] brunofr at ioda dot net
exactly the same error with opensuse package ( build repos server/php )
under 11.1 version 

If export TZ in profile or apache2 startup script 
it works.
 [2009-10-05 22:03 UTC] warwick dot shaw at gmail dot com
To reproduce on "CentOS release 5.3 (Final)"
Any syntax error in the /usr/lib/lib/php.ini causes the above.

In my case
...
date.timezone='America/New_York'
...
extension = "tidy.so"a

Remove the trailing "a" then ok

Other cases that caused same the error
1. an extension doesn't exist
extension = "doesnotexist.so"

2. an extension was installed from a rpm for a previous version. 


A command to just validate the php.ini configuration would be handy.
 [2009-11-05 16:25 UTC] mkliewe at gmx dot de
I had the same problem. I tried date.timezone and date_default_timezone_set(), but nothing worked.

The real problem was an extension load problem. after solving this the error disappeared. Strange behaviour.
 [2010-02-24 18:06 UTC] theodore at phpexperts dot pro
I experienced this with PHP 5.3.0-Thread Safe on Windows XP SP3, running 
Wamp.

I was trying to load the blitz extension, which was never being picked 
up.  Upon finding this bug report, I found out that php_ftp.dll did not 
exist; the php.ini was not interrupted past the line

extension=php_ftp.dll

After commenting out that line, everything under it (including blitz) 
was parsed.

I consider this a pretty serious bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 11:01:28 2024 UTC