php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73015 Timezone database is corrupt error message appears
Submitted: 2016-09-05 00:32 UTC Modified: 2016-09-30 16:30 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: ozgurh at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 7.0.10 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ozgurh at gmail dot com
New email:
PHP Version: OS:

 

 [2016-09-05 00:32 UTC] ozgurh at gmail dot com
Description:
------------
When I try to get date with $now = date('YmdHis'); command, sometimes (not all the time) I get PHP Fatal error: date(): Timezone database is corrupt - this should *never* happen! in line 78 error. 

When I restart php70-php-fpm everything just works perfect for a while (~ from 6 hours to 24 hours) then same error appears again (as I said not all the time it appears 1 in every 2 or 3 requests). 

I Installed php 5.6.25 on the same environment and everthing perfectly works. It's look like it appears only in 7.0.10

I have 8 servers with php 7.0.10 and 8 servers with php 5.6.25.I get this error message in all of the 7.0.10 servers and never seen this message in 5.6.25 servers.

I installed php 7.0.10 with yum install.

Environment : 
Amazon Linux 2016.03 release
php 7.0.10 (php70-php-fpm)
NginX 1.8.1

php -v : 
PHP 7.0.10 (cli) (built: Aug 27 2016 05:21:17) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.10, Copyright (c) 1999-2016, by Zend Technologies



Expected result:
----------------
$now = date('YmdHis'); command should work with default php installation without to set anything.

Actual result:
--------------
PHP Fatal error: date(): Timezone database is corrupt - this should *never* happen! in line 78

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-05 09:16 UTC] cmb@php.net
-Package: date_time +Package: Date/time related
 [2016-09-06 15:34 UTC] ozgurh at gmail dot com
Here is the php.ini lines for date section.

date/time support	enabled
"Olson" Timezone Database Version	0.system
Timezone Database	internal
Default timezone	UTC
Directive	Local Value	Master Value
date.default_latitude	31.7667	31.7667
date.default_longitude	35.2333	35.2333
date.sunrise_zenith	90.583333	90.583333
date.sunset_zenith	90.583333	90.583333
date.timezone	UTC	UTC
 [2016-09-30 15:37 UTC] bruno dot macadre at univ-rouen dot fr
Hi,

I've got the same problem on a fresh ubuntu 16.04 server install.

Without date.timezone defined in /etc/php/7.0/fpm/php.ini nor in my pool definition, phpinfo(); works great and says :
Default Timezone = Europe/Berlin
date.timezone = No Value

If I put a value to date.timezone in php.ini or pool conf file, the phpinfo(); hangs just before displaying Default Timezone.

If I remove date.timezone value in php.ini and pool conf file and try this code :
<?php
date_default_timezone("Europe/Paris");
phpinfo();
?>

Instead of displaying phpinfo() I got this error message : Fatal error: date_default_timezone_set(): Timezone database is corrupt - this should *never* happen! in /www/index.php on line 3

Environment :
Ubuntu Server 16.04 x64
PhP-FPM : 
PHP 7.0.8-0ubuntu0.16.04.2 (fpm-fcgi)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies

PhP:
PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies



Regards,
Bruno
 [2016-09-30 15:48 UTC] bruno dot macadre at univ-rouen dot fr
Re,

After searching a bit deeper, I found that this error occurs in a chrooted environment where /usr/share/zoneinfo is unreachable.

In my case I use chroot directive in my FPM pool, so I tried to copy entire /usr/share/zoneinfo data into my Jail and the error disappear !!

I don't know If you're in the same case than me but for me the problem is solved...
 [2016-09-30 16:30 UTC] derick@php.net
-Status: Open +Status: Not a bug
 [2016-09-30 16:30 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Using /usr/share/zoneinfo is a Linux distribution change to PHP, and not something we endorse or like. Please complain to your Linux distribution about this.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 07:00:02 2026 UTC