我遇到了一些解析XML文件的PHP脚本的麻烦。这些脚本几个月来一直运行无误,并且今天突然全部崩溃。代码或环境未做任何更改。我相对较新的PHP,所以任何帮助,将不胜感激。simplexml警告和错误
下面是我看到的错误:
Warning: simplexml_load_file() [function.simplexml-load-file]: c:/server/public_html/dev/temp.xml:1: parser error : Opening and ending tag mismatch: HR line 1 and body in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]: LED).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.32</h3></body> in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]:^in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]: c:/server/public_html/dev/temp.xml:1: parser error : Opening and ending tag mismatch: HR line 1 and html in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]: u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.32</h3></body></html> in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]:^in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]: c:/server/public_html/dev/temp.xml:1: parser error : Premature end of data in tag body line 1 in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]: u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.32</h3></body></html> in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]:^in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]: c:/server/public_html/dev/temp.xml:1: parser error : Premature end of data in tag html line 1 in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]: u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.32</h3></body></html> in C:\Server\public_html\dev\index.php on line 31
Warning: simplexml_load_file() [function.simplexml-load-file]:^in C:\Server\public_html\dev\index.php on line 31
Warning: Invalid argument supplied for foreach() in C:\Server\public_html\dev\index.php on line 35
我们可以看到你正在试图加载XML?看起来它实际上是HTML,它不是有效的XML。 – halfer