PHP Mashup Sorunlar

2 Cevap

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;

İşte benim php kodu:

<?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

Bu Gördüğünüz gibi bir doğru xml dosyasıdır.

2 Cevap

allow_url_open devre dışı olabilir.

wget-ing veya kıvrılma-ing bunu gibi, http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api%5Fkey=46566747d88fe250fd631deb0033023a&user%5Fid=64002153@N00 sunucu üzerindeki diğer yollarla okumaya çalışın.

Sunucu @ Ivan işaret itibariyle vadesi PHP yapılandırma, muhtemelen nedeniyle güvenlik duvarı veya DNS ayarları, flickr sitesine bağlanmak ya da mümkün değil gibi (ben hata mesajı daha sonra farklı bir olacağına inanıyorum rağmen) görünüyor.

Eğer sunucu tür yayınlanıyor?

Ayrıca, (localhost veya 127.0.0.1) yerel etki dosyayı yüklemeyi deneyin? Olabilir O zaman çalışır mı?

Aynı zamanda bir DNS sorunu olabilir. Yapar hostname yerine bir IP tarafından flickr sunucusu teklif erişim?