我在php-fpm上调用date()
时出错。`PHP致命错误:日期():时区数据库已损坏`上redhat 6.9,nginx,php-fpm
我知道php-fpm与phpinfo()
运作良好。
我已经给予权限777至/usr/share/zoneinfo
和/etc/localtime
。但仍然没有工作。
这是我的源代码和environemnt。
# time.php
<?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
[[email protected] ~]# 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
[[email protected] ~]# nginx -v
nginx version: nginx/1.12.0
[[email protected] ~]# 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
我不知道它是否相关。我为'localhost(服务器名称)'设置了网络时间服务器。 – bismute