2017-08-11 07:53
浏览 283

`PHP致命错误:date():redhat 6.9,nginx,php-fpm上的时区数据库已损坏

I got an error while calling date() on php-fpm.

I know php-fpm works well with phpinfo() operates.

I have given permission 777 to /usr/share/zoneinfo and /etc/localtime. But still not working.

Here's my source code and environemnt.

# time.php
    echo date('r');

# php-fpm error log
[11-Aug-2017 16:18:41] WARNING: [pool www] child 64492 said into stderr: "NOTICE: PHP message: PHP Fatal error:  strftime(): Timezone database is corrupt - this should *never* happen! in ******time.php in line 2"

# current environment
[root@localhost ~]# lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.9 (Santiago)
Release:        6.9
Codename:       Santiago
[root@localhost  ~]# nginx -v
nginx version: nginx/1.12.0
[root@localhost  ~]# php -v
PHP 5.3.3 (cli) (built: Nov  7 2016 11:21:30)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

图片转代码服务由CSDN问答提供 功能建议

我在php-fpm上调用 date()时遇到错误。

我知道php-fpm适用于 phpinfo()操作。

我已将权限777授予 / usr / share / zoneinfo / etc / localtime 。 但仍然无效。


 echo date  ('r'); 
 [11-Aug-2017 16:18:41]警告:[pool www] child 64492对stderr说:“注意:  PHP消息:PHP致命错误:strftime():时区数据库已损坏 - 这应该*永远不会发生!在第2行的****** time.php中“
#current environment 
 [root @ localhost  〜] #lsb_release -a 
LSB版本:: base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0  -amd64:printing-4.0-noarch 
 [root @ localhost~] #nginx -v 
nginx版本:  nginx / 1.12.0 
 [root @ localhost~] #php -v 
PHP 5.3.3(cli)(内置:2016年11月7日11:21:30)
版权所有(c)1997-2010 PHP小组
Zend 引擎v2.3.0,版权所有(c)1998-2010 Zend Technologies 
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dqtdz08206 2017-11-10 06:24
    点赞 打赏 评论
  • dousilie9522 2017-08-11 08:18

    Try reinstalling the system timezone database 'stuff' -

    yum reinstall tzdata
    点赞 打赏 评论

相关推荐 更多相似问题