Php [domdocument.load]:无法打开流:getaddrinfo失败:已知数据库中没有此类主机

Php [domdocument.load]:无法打开流:getaddrinfo失败:已知数据库中没有此类主机,php,xml,Php,Xml,我创建了一个从wordpress站点将外部XML加载到HTML页面的页面。它可以在本地进行我的MAMP测试。当我将其安装到用于生产的服务器上时,php脚本出现错误: DOMDocument::load():无法打开流:php\u network\u getaddresses:getaddrinfo失败:没有已知的此类主机 代码的脚本就在这里,所有信息都在这里被提取 $rss = new DOMDocument(); $rss->load("http://blog.website.com/f

我创建了一个从wordpress站点将外部XML加载到HTML页面的页面。它可以在本地进行我的MAMP测试。当我将其安装到用于生产的服务器上时,php脚本出现错误:

DOMDocument::load():无法打开流:php\u network\u getaddresses:getaddrinfo失败:没有已知的此类主机

代码的脚本就在这里,所有信息都在这里被提取

$rss = new DOMDocument();
$rss->load("http://blog.website.com/feed/");
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
'author' => $node->getElementsByTagName('creator')->item(0)->nodeValue,
);

检查了php.ini并启用了fopen,因此我不太清楚为什么会出现此问题。

您访问过该机器上的终端吗?您可以ping
blog.website.com
?(或它代表什么)不,似乎我无法ping地址。还ping了ip地址本身,请求超时。您必须更改服务器的DNS或网络设置