将系统放入服务器的错误消息的解决方案是什么?

时间:2014-04-01 06:53:23

标签: php

当我在localhost中运行我的系统时,它是成功的。但当我把它放入服务器时,它会显示此错误消息..问题是什么?

Strict Standards</b>:  Non-static method DOMDocument::loadXML() should not be called statically, assuming $this from incompatible context in <b>F:\htdocs\bricksmind\hafiz\dochelper.php</b> on line <b>58

以下是dochelper.php的第58行:

$Xml = DOMDocument::loadXML($Data, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);

1 个答案:

答案 0 :(得分:0)

导致此错误的原因是您在静态时静态调用方法loadXML

您可以通过以下方式解决此问题:

// create a DOMDocument instance
$doc = new DOMDocument();

// call the method on the instance
$doc->loadXML($Data, LIBXML_NOENT | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING);

// then print the XML 
echo $doc->saveXML();

希望这会有所帮助: - )