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 8924271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:21:59+00:00 2026-06-15T07:21:59+00:00

I have this code : $feed = ‘urltorss’; $feeds = new SimpleXmlElement( file_get_contents($feed) );

  • 0

I have this code :

$feed = 'urltorss';
$feeds =  new SimpleXmlElement( file_get_contents($feed) );


$feed = 'http://www.businessweek.com/feeds/homepage.rss';
$feeds =  new SimpleXmlElement( file_get_contents($feed) );

Now both urls don’t have any special characters that require url encoding them, but the 2nd url has an .rss extension if it’s related.

The first call works and i get a timeout on the 2nd when i try on my server but works perfectly on localhost.

This is the error i’m getting :

    Severity: Warning

Message: file_get_contents('http://www.businessweek.com/feeds/homepage.rss')
[function.file-get-contents]: 
failed to open stream: Connection timed out

Filename: controllers/mailsystem.php

Line Number: 36

Why is that?

  • 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-06-15T07:22:00+00:00Added an answer on June 15, 2026 at 7:22 am

    First, check your path so
    echo $feed; // just for debug
    then check the content
    $content = @file_get_contents($feed);
    and in the end, get the XML
    if( $content ) { $feeds = new SimpleXmlElement( file_get_contents($feed) ); }

    Edit: file_get_contents for URLs will only work if you have allow_url_fopen = 1. To get the content of http://www.businessweek.com/feeds/homepage.rss you need a cURL function that gets the content. Something like http://davidwalsh.name/curl-download

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

Sidebar

Related Questions

I have this code to create an ATOM feed Dim xmlResult As New StringBuilder
I have been running this code (from: http://blog.somethingaboutcode.com/?p=155 ): from twisted.internet import reactor from
I have this page where I am doing testing http://www.comehike.com/test_fb_connect.php The button works fine
In my CSS code, I have this: #feed .post:hover .rep {display:inline;} #feed .post:hover .com
I use this bit of code to feed some data i have parsed from
I have this code : void Main() { System.Timers.Timer t = new System.Timers.Timer (1000);
Hey there, I have this code... when i mouseover the flash feed it flickers
I have this string: tag:domain.com,2012-10-12:feed/channel/id/335 Im trying to get the last digits from this
I have this code to parse an RSS feed but for some reason my
I have used this code to get a feed reader form twitter. I have

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.