Tôi có trang web wordpress đột ngột ngừng hoạt động ngay hôm nay. Khi tôi nhìn vào các bản ghi tôi nhìn thấy và báo lỗi:Cơ sở dữ liệu múi giờ PHP là lỗi bị lỗi
[error] [client 50.78.108.177] PHP Fatal error: strtotime(): Timezone database is corrupt - this should never happen!
Sau khi đọc lên trên google một người nói rằng họ đã phát hiện ra một vấn đề quyền trong /usr/share/zoneinfo. Tôi đã thử thay đổi các điều khoản cho 777, 775, 770 và tôi vẫn tiếp tục nhận được lỗi tương tự. Tôi đang chạy php PHP 5.3.2 trên Ubuntu 10.04.3 LTS. Bất kỳ đề xuất hoặc đề xuất nào đều hữu ích. Nếu mọi thứ khác không thành công, tôi sẽ cố gắng hạ cấp xuống phiên bản cũ hơn của php nhưng tôi muốn thử những thứ khác trước khi thực hiện điều đó.
cảm ơn, Timnit
Cập nhật
chỉ trong trường hợp nó giúp: các điểm lỗi để strtotime
trong hàm dưới
function mysql2date($dateformatstring, $mysqlstring, $translate = true) {
$m = $mysqlstring;
if (empty($m))
return false;
if ('G' == $dateformatstring)
return strtotime($m . ' +0000');
$i = strtotime($m);
if ('U' == $dateformatstring)
return $i;
if ($translate)
return date_i18n($dateformatstring, $i);
else
return date($dateformatstring, $i);
}
Cập nhật # 2:
cho bây giờ tôi đã khắc phục sự cố bằng cách chỉ cần có hàm ở trên return false;
mà không thực hiện bất kỳ điều gì. Tuy nhiên tôi vẫn chưa tìm ra nguyên nhân gốc rễ của vấn đề.
cập nhật # 3:
var_dump($dateformatstring)
string(5) "d.m.y" string(1) "m" string(5) "d.m.y" string(1) "m" string(5) "d.m.y" string(1) "m"
var_dump($mysqlstring)
string(19) "2011-10-20 05:35:01" string(19) "2011-10-20 05:35:01" string(19) "2011-10-20 05:25:22" string(19) "2011-10-20 05:25:22" string(19) "2011-10-19 05:10:06" string(19) "2011-10-19 05:10:06"
cập nhật # 4:
có một đoạn mã được tạo ra các bản ghi lỗi dưới đây:
PHP Fatal error: date(): Timezone database is corrupt - this should never happen! in /srv/www/motionthink.com/public_html/wp-admin/includes/class-wp-filesystem-direct.php on line 346, referer: wp_root_directory/wp-admin/plugins.php?plugin_status=upgrade
309 function dirlist($path, $include_hidden = true, $recursive = false) {
310 if ($this->is_file($path)) {
311 $limit_file = basename($path);
312 $path = dirname($path);
313 } else {
314 $limit_file = false;
315 }
316
317 if (! $this->is_dir($path))
318 return false;
319
320 $dir = @dir($path);
321 if (! $dir)
322 return false;
323
324 $ret = array();
325
326 while (false !== ($entry = $dir->read())) {
327 $struc = array();
328 $struc['name'] = $entry;
329
330 if ('.' == $struc['name'] || '..' == $struc['name'])
331 continue;
332
333 if (! $include_hidden && '.' == $struc['name'][0])
334 continue;
335
336 if ($limit_file && $struc['name'] != $limit_file)
337 continue;
338
339 $struc['perms'] = $this->gethchmod($path.'/'.$entry);
340 $struc['permsn'] = $this->getnumchmodfromh($struc['perms']);
341 $struc['number'] = false;
342 $struc['owner'] = $this->owner($path.'/'.$entry);
343 $struc['group'] = $this->group($path.'/'.$entry);
344 $struc['size'] = $this->size($path.'/'.$entry);
345 $struc['lastmodunix']= $this->mtime($path.'/'.$entry);
346 $struc['lastmod'] = date('M j',$struc['lastmodunix']);
347 $struc['time'] = date('h:i:s',$struc['lastmodunix']);
348 $struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd:'f';
349
Cập nhật # 5:
làm một php -i | fgrep -i date
lợi nhuận
Build Date => Dec 13 2011 18:43:02
date date/time support => enabled 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 => no value => no value
sau đó tôi đã chỉnh sửa file php.ini để thiết lập múi giờ để "Châu Mỹ/Los Angeles" và nhận được kết quả này
date/time support => enabled
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 => America/Los_Angeles => America/Los_Angeles
Tôi sau đó khởi động lại apache2. Tôi vẫn nhận được lỗi
* panda buồn *, tất cả những gì đang gỡ lỗi:/ –