我在日志消息中收到此错误:
PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML'
在我的localhost中一切正常,我没有任何日志错误,但在远程我得到错误,提要是验证,我现在不能做我现在能做的, 代码是:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FAILONERROR,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$retValue = curl_exec($ch);
curl_close($ch);
$sXML = $retValue;
-> $xml = new SimpleXMLElement($sXML);
$cnt = count($xml->channel->item);
错误是我放的地方 - >