मेरे पास एक वर्डप्रेस वेबसाइट है जो अचानक काम करना बंद कर देती है। जब मैं लॉग मैं देख रहा हूँ और त्रुटि को देखो:PHP टाइमज़ोन डेटाबेस दूषित त्रुटि
[error] [client 50.78.108.177] PHP Fatal error: strtotime(): Timezone database is corrupt - this should never happen!
गूगल पर पढ़ने के बाद एक व्यक्ति ने कहा कि वे /usr/share/zoneinfo में अनुमतियों की समस्या की खोज की। मैंने 777, 775, 770 पर अनुमतियों को बदलने की कोशिश की और मुझे अभी भी वही त्रुटि मिल रही है। मैं उबंटू 10.04.3 एलटीएस पर PHP PHP 5.3.2 चला रहा हूं। कोई सुझाव या सिफारिशें सहायक होंगी। अगर सब कुछ विफल हो जाता है तो मैं php के पुराने संस्करण में डाउनग्रेड करने की कोशिश करने जा रहा हूं लेकिन मैं ऐसा करने से पहले अन्य चीजों को आजमाने की कोशिश करता हूं।
धन्यवाद, Timnit
अद्यतन
सिर्फ मामले में यह मदद करता है: strtotime
करने के लिए त्रुटि अंक समारोह में नीचे
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);
}
अद्यतन # 2:
अब के लिए मैं कुछ भी किए बिना return false;
से ऊपर कार्य करके बस समस्या को ठीक कर दिया है। हालांकि मुझे अभी भी समस्या का मूल कारण नहीं पता है।
अद्यतन # 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"
अद्यतन # 4:
:एक और कोड स्निपेट कि त्रुटि लॉग नीचे पैदा कर रहा है है
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
अद्यतन # 5:
कर एक php -i | fgrep -i date
रिटर्न
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
तो मैं समय-क्षेत्र पर "अमेरिका/लॉस एंजिल्स" स्थापित करने के लिए php.ini फ़ाइल संपादित और इस उत्पादन मिला
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
मैंने फिर apache2 को पुनरारंभ किया। मैं अभी भी त्रुटि
* उदास पांडा *, यह सब डिबगिंग:/ –