【发布时间】:2015-12-13 19:50:46
【问题描述】:
我无法加载要加载的 xml 文件。
这段代码效果很好:
$url = 'http://www.w3schools.com/xml/note.xml';
$xml = simplexml_load_file($url);
print_r($xml);
但是这个
$url = 'https://www.boardgamegeek.com/xmlapi2/thing?id=105551';
$xml = simplexml_load_file($url);
print_r($xml);
不起作用。我收到此错误:
警告:simplexml_load_file():SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:/storage/content/59/113059/boardgamelevelup.com/public_html/index 中的证书验证失败。第 19 行的 php 警告: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 警告:无法在 /storage/content 中加载外部实体“https://www.boardgamegeek.com/xmlapi2/thing?id=105551” /59/113059/boardgamelevelup.com/public_html/index.php 第 19 行
boardgamegeek 的 xml 文件适用于其他网站。我应该使用不同的 php 代码来加载那个 xml 文件吗?
【问题讨论】:
-
您的网络服务器配置存在 SSL 问题。