dongshanxun6479 2009-11-26 14:51
浏览 52
已采纳

PHP Mashup中的问题

I have a problem in implementing Mashups in PHP. Now I am using PHP Version5.

I want to fetch flickr photo information from the site. And I think the code is correct. But I always face such errors as follows;

Here is my php code:

<?php
header('Content-Type: text/xml');
?>
<?php
$url="http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=46566747d88fe250fd631deb0033023a&user_id=64002153@N00";
$url=DOMDocument::load($url);
echo $url->saveXML();
?>

As you can see I am going to fetch remote xml file from flickr site. But I am always stalled by this error:

Warning: DOMDocument::load() [function.DOMDocument-load]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\mashup\k\flickrproxy.php on line 13

Warning: DOMDocument::load(http://...@N00) [function.DOMDocument-load]: failed to open stream: No such file or directory in C:\wamp\www\mashup\k\flickrproxy.php on line 13

Warning: DOMDocument::load() [function.DOMDocument-load]: I/O warning : failed to load external entity "http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=46566747d88fe250fd631deb0033023a&user_id=64002153@N00" in C:\wamp\www\mashup\k\flickrproxy.php on line 13

You can just think that the remote file does not exist but there it is. link text

This is a accurate xml file as you can see.

  • 写回答

2条回答 默认 最新

查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧,别用大模型回答,大模型的答案没啥用
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。