我无法加载xml文件.
这段代码效果很好:
$url = 'http://www.w3schools.com/xml/note.xml';
$xml = simplexml_load_file($url);
print_r($xml);
Run Code Online (Sandbox Code Playgroud)
但这一个
$url = 'https://www.boardgamegeek.com/xmlapi2/thing?id=105551';
$xml = simplexml_load_file($url);
print_r($xml);
Run Code Online (Sandbox Code Playgroud)
不起作用.我收到此错误:
警告:simplexml_load_file():SSL操作失败,代码为1. OpenSSL错误消息:错误:14090086:SSL例程:SSL3_GET_SERVER_CERTIFICATE:证书验证在/storage/content/59/113059/boardgamelevelup.com/public_html/index.php上失败19警告:simplexml_load_file():无法在第19行的/storage/content/59/113059/boardgamelevelup.com/public_html/index.php中启用加密警告:simplexml_load_file(https://www.boardgamegeek.com/xmlapi2/thing ?id = 105551):无法打开流:第19行/storage/content/59/113059/boardgamelevelup.com/public_html/index.php中的操作失败警告:simplexml_load_file():I/O警告:无法加载外部实体" https://www.boardgamegeek.com/xmlapi2/thing?id=105551"在第19行的/storage/content/59/113059/boardgamelevelup.com/public_html/index.php中
boardgamegeek的xml文件适用于其他网站.我应该使用不同的PHP代码来加载该xml文件吗?