2017-08-21 58 views
0

Hy人,我最近將我的網站遷移到了新服務器,現在每當我進入我的首頁時我都會收到錯誤消息。如何解決Joomla網站上的html解析器錯誤?

http://144.130.57.197/MonashHealthNew/beta.monashhealth.org/en/

這是我得到的錯誤,我對此毫無頭緒:

parser = xml_parser_create($encoding); xml_set_object($this->parser, &$this); xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1); xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, 'UTF-8'); xml_set_element_handler($this->parser, "start_element", "stop_element"); xml_set_character_data_handler($this->parser, "char_data"); } function force_to_array() { for ($i = 0; $i < func_num_args(); $i++) { $this->force_to_array[] = func_get_arg($i); } } /* Parse XML data, storing it in the instance variable; returns false if the data cannot be parsed. */ function parse($data) { $this->tree = array(); if (!xml_parse($this->parser, $data, 1)) { $this->error = "xml parse error: " . xml_error_string(xml_get_error_code($this->parser)) . " on line ".xml_get_current_line_number($this->parser); return false; } return $this->tree[0]["content"]; } function parse_file($file) { $fp = @fopen($file, "r"); if (!$fp) { user_error("unable to open file: '$file'"); return false; } while ($data = fread($fp, 4096)) { if (!xml_parse($this->parser, $data, feof($fp))) { user_error("xml parse error: " . xml_error_string(xml_get_error_code($this->parser)) . " on line " . xml_get_current_line_number($this->parser)); } } fclose($fp); return $this->tree[0]["content"]; } function encode_as_xml($value) { if (is_array($value)) { reset($value); $out = ''; while (list($key,$val) = each($value)) { if (is_array($val) && isset($val[0])) { reset($val); while (list(,$item) = each($val)) { $out .= "".xml_simple::encode_as_xml($item).""; } } else { $out .= "".xml_simple::encode_as_xml($val).""; } } return $out; } else { return htmlspecialchars($value); } } function start_element($parser, $name, $attrs) { array_unshift($this->tree, array("name" => $name)); } function stop_element($parser, $name) { if ($name != $this->tree[0]["name"]) die("incorrect nesting"); if (count($this->tree) > 1) { $elem = array_shift($this->tree); if (isset($this->tree[0]["content"][$elem["name"]])) { if (is_array($this->tree[0]["content"][$elem["name"]]) && isset($this->tree[0]["content"][$elem["name"]][0])) { array_push($this->tree[0]["content"][$elem["name"]], $elem["content"]); } else { $this->tree[0]["content"][$elem["name"]] = array($this->tree[0]["content"][$elem["name"]],$elem["content"]); } } else { if (in_array($elem["name"],$this->force_to_array)) { $this->tree[0]["content"][$elem["name"]] = array($elem["content"]); } else { if (!isset($elem["content"])) $elem["content"] = ""; $this->tree[0]["content"][$elem["name"]] = $elem["content"]; } } } } function char_data($parser, $data) { # don't add a string to non-string data if (!is_string($this->tree[0]["content"]) && !preg_match("/\S/", $data)) return; $this->tree[0]["content"] .= $data; } }

但是我的網站的其他頁面正在完善。您可以通過訪問此頁面看看 http://144.130.57.197/MonashHealthNew/beta.monashhealth.org/en/contact-us

我會很感激你的任何類型的幫助。提前致謝。

回答

0

我認爲xml-simple.php是問題所在。如果您查看源(在主頁上http://144.130.57.197/MonashHealthNew/beta.monashhealth.org/en/),它的開始:

<? 

/* XML-simple.php

你可以改變這(在XML-simple.php文件)?

<?php 

/* XML-simple.php

我覺得 'short_open_tag的值爲' 在配置(php.ini中)被禁用

+0

改變。現在500錯誤即將到來。 這是鏈接 http://imgur.com/a/mjtmC –

+0

您可以檢查500錯誤的錯誤日誌。 但我在主頁上看不到任何錯誤,修復? http://144.130.57.1​​97/MonashHealthNew/beta.monashhealth.org/en/ – user1233035

+0

我已禁用顯示500錯誤的模塊。謝謝 –