Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 662609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:23:51+00:00 2026-05-13T23:23:51+00:00

$fp = fopen(http://feeds.reuters.com/Reuters/PoliticsNews?format=xml,r) or die(Error reading RSS data.); The above coding working correctly in

  • 0
$fp = fopen("http://feeds.reuters.com/Reuters/PoliticsNews?format=xml","r")
    or die("Error reading RSS data.");

The above coding working correctly in localhost;;;

but in server display “Error reading RSS data.”…

i dont know why….

anybody please explain me…

i am waiting…

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:23:51+00:00Added an answer on May 13, 2026 at 11:23 pm

    A possible reason could be that allow_url_fopen might be disabled (quoting) :

    This option enables the URL-aware
    fopen wrappers that enable accessing
    URL object like files.

    You can check using the phpinfo() function, to see if it’s enabled or not.

    If it’s not enabled, you’ll have to use another solution to send the HTTP request that fetches that remote content.

    Using curl might be a solution, for instance ; see curl_exec for a quick example, and curl_setopt for a list of all possible options.

    Here’s what a simple request would look like, though :

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://feeds.reuters.com/Reuters/PoliticsNews?format=xml");
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    $feed = curl_exec($ch);
    curl_close($ch);
    

    This will get you the content of the feed in $feed — but check the manual page of curl_setopt : there are so many options that going through the list cannot be a bad idea.

    Still, as a precaution, before going this way, you might want to check if curl is enabled, is the output of `phpinfo()`…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Answer : Implemented using Curl... $file = http://abc.com/data//output.txt; $ch = curl_init($file); $fp = @fopen(out.txt,
I'm trying to create some xml , basically by reading rss feeds and adding
im using a simple test script from http://www.tuxradar.com/practicalphp/8/11/0 like this <?php $fp = fopen(foo.txt,
from a PHP script I'm downloading a RSS feed like: $fp = fopen('http://news.google.es/news?cf=all&ned=es_ve&hl=es&output=rss','r') or
I have a script that reads RSS feeds using fopen & fgets. When trying
I tried this code: $image = new Imagick(); $f = fopen('http://www.url.com/image.jpg', 'rb'); $image =
I was trying out this tutorial for reading rss feeds with a php file
It looks like fopen can't open files with spaces. For example: $url = 'http://gatewaypeople.com/images/articles/cntrbutnssttmnts12_main
So: @fopen($file); Ignores any errors and continues fopen($file) or die(Unable to retrieve file); Ignores
I'm using fopen to read from a file $fh = fopen($path, 'r') or die('Could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.