php - SimpleXMLElement 错误 ,错误讯息http error 503
伊谢尔伦
伊谢尔伦 2017-04-10 15:01:00
0
1
581

在执行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的方式?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

모든 응답(1)
左手右手慢动作

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

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!