PHP启动:时区数据库已损坏

我有一个CentOS 5.2服务器。 PHP现在在5.2.10版本(php-5.2.10-1.el5.remi.i386),我已经更新到5.3,tzdata也被更新(tzdata-2009i-2.el5.noarch)。 自更新以来,Apache拒绝启动,因为PHP崩溃。

这里是httpd / error.log

[Wed Jul 08 11:40:21 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Wed Jul 08 11:40:24 2009] [notice] Digest: generating secret for digest authentication ... [Wed Jul 08 11:40:24 2009] [notice] Digest: done 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` 'Europe/Berlin' for 'CEST/2.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** 

最好的问候,Cédric

这似乎是一个在php.net上打开的错误: http ://bugs.php.net/bug.php?id= 48882

这里build议

(apache) init.d脚本中添加TZ = GMT

它应该解决这个问题。

这是一个古老的问题,但无论如何,答案是这样的:提问者使用suExec机制。 那些使用mod_chroot或chrootDir内置的apache2将遇到类似的问题。

确保存在{chroot} / etc / localtime和{chroot} / usr / share / zoneinfo – 就是这样。

信贷去: http : //www.phwinfo.com/forum/alt-comp-lang-php/315265-timezone-database-corrupt.html#post1410153

根据以前的答案(CentOS v6)修复:

 nano /etc/init.d/httpd 

但是不是UTC,而是GMT + 1。 法国可能是GMT。

 export TZ="Europe/Berlin" 

并重新启动:

 service httpd restart