Jump to content

why file_get_contents not work?


1965

Recommended Posts

Hi. All. I donot know why there are errors below. I tried several times but still can not work out. The url does really exist because I use it very day in ie. But if I use PHP code, it can not work. Please help.

 

<?php

$file = file_get_contents ('http://ws.geonames.org/rssToGeoRSS?feedUrl=http%3A%2F%2Fhosted.ap.org%2Fl ineups%2FWORLDHEADS-rss_2.0.xml%3FSITE%3DRANDOM%26SECTION%3DHOME');

Echo $file;

?>

 

 

In IE

Warning: file_get_contents(http://ws.geonames.org/rssToGeoRSS?feedUrl=http%3A%2F%2Fhosted.ap.org%2Fl ineups%2FWORLDHEADS-rss_2.0.xml%3FSITE%3DRANDOM%26SECTION%3DHOME): failed to open stream: HTTP request failed! in D:\wwwroot\guoshesen\wwwroot\map\rssxml.php on line 3

 

In IE

Warning: file_get_contents(http://ws.geonames.org/rssToGeoRSS?feedUrl=http%3A%2F%2Fhosted.ap.org%2Fl ineups%2FWORLDHEADS-rss_2.0.xml%3FSITE%3DRANDOM%26SECTION%3DHOME): failed to open stream: HTTP request failed! in D:\wwwroot\guoshesen\wwwroot\map\rssxml.php on line 3

 

In Opera:

Fatal error: Maximum execution time of 30 seconds exceeded in D:\wwwroot\guoshesen\wwwroot\map\rssxml.php on line 3

Link to comment
https://forums.phpfreaks.com/topic/71028-why-file_get_contents-not-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.