SimpleXMLElement 错误 ,错误讯息http error 503

发布于 2022-08-29 21:29:36 字数 3284 浏览 14 评论 0

在执行pannalesports的api (反正就是一个抓数据的api)
我用 SimpleXMLElement 将数据转成xml的格式 方便我去作截取。但总是在执行一段时间后会出现错误

p.s. 我用curl 先抓下来才转成curl

curl_setopt($httpChannel, CURLOPT_URL, $url);
curl_setopt($httpChannel, CURLOPT_RETURNTRANSFER, true);
curl_setopt($httpChannel, CURLOPT_HTTPHEADER, $IP);
curl_setopt($httpChannel, CURLOPT_HTTPHEADER, $header);
curl_setopt($httpChannel, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($httpChannel);

(这个其实不是重点)

重点是以下的错误讯息
我用try,在SimpleXMLElement错误时,把data和 $e print_r出来如后

Exception Object ( [message:protected] => String could not be parsed as XML [string:private] => [code:protected] => 0 [file:protected] => /home/ns/www/gamble/mlb.php [line:protected] => 66 [trace:private] => Array ( [0] => Array ( [file] => /home/ns/www/gamble/mlb.php [line] => 66 [function] => __construct [class] => SimpleXMLElement [type] => -> [args] => Array ( [0] => ) ) ) ) 2014-10_01 20:02:12

Exception Object ( [message:protected] => String could not be parsed as XML [string:private] => [code:protected] => 0 [file:protected] => /home/ns/www/gamble/mlb.php [line:protected] => 66 [trace:private] => Array ( [0] => Array ( [file] => /home/ns/www/gamble/mlb.php [line] => 66 [function] => __construct [class] => SimpleXMLElement [type] => -> [args] => Array ( [0] => ) ) ) ) Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Space required after the Public Identifier in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): ^ in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): Entity: line 6: parser error : Opening and ending tag mismatch: hr line 5 and BODY in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): ^ in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): Entity: line 6: parser error : Opening and ending tag mismatch: BODY line 4 and HTML in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): ^ in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): Entity: line 7: parser error : Premature end of data in tag HEAD line 2 in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): ^ in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): Entity: line 7: parser error : Premature end of data in tag HTML line 2 in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): in /home/ns/www/gamble/mlb.php on line 66 Warning: SimpleXMLElement::__construct(): ^ in /home/ns/www/gamble/mlb.php on line 66 

$e 错误如下

Service Unavailable
HTTP Error 503. The service is unavailable.

有没有解除或debug的方式?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

熊抱啵儿 2022-09-05 21:29:36

HTTP错误503是服务器内部错误。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文