need help with function.fopen

Discussion in 'PHP' started by bemoi, Nov 2, 2009.

  1. #1
    i got this error when i try to display rss feed from google

    the link is http://egyptbusinessguide.com/acne/

    Warning: fopen(http://news.google.com/news?sourceid=navclient&ie=UTF-8&rls=GGLG,GGLG:2005-22,GGLG:en&q=Acne&output=rss) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.0 503 Service Unavailable in /home/bemoi/egyptbusinessguide.com/acne/inc/rss.inc on line 81
    could not open XML input

    i don't understand, 5 minutes ago it was working fine, now, it don't, can anyone tell me what to do?

    by the way, i dont have access to php.ini
     
    bemoi, Nov 2, 2009 IP
  2. unitechy

    unitechy Peon

    Messages:
    350
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    is it possible that the source of your rss disappeared? :p cause its giving 503 error.
     
    unitechy, Nov 2, 2009 IP
  3. bemoi

    bemoi Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    nop, cause when i can access it from http://news.google.com/news?sourceid=navclient&ie=UTF-8&rls=GGLG,GGLG:2005-22,GGLG:en&q=Acne&output=rss
     
    bemoi, Nov 2, 2009 IP
  4. bemoi

    bemoi Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    now i tried it locally and it worked, i guess that error is a server thingy not a script error, but i cant figure it out
     
    bemoi, Nov 2, 2009 IP
  5. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #5
    
    HTTP/1.0 503 Service Unavailable
    
    Code (markup):
    This line tells that the problem is on server you trying to connect to.
     
    AsHinE, Nov 2, 2009 IP
  6. xenon2010

    xenon2010 Peon

    Messages:
    237
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    mate use curl..
     
    xenon2010, Nov 2, 2009 IP
  7. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Get with your host. They may have disallowed the use of fopen. Some hosts do as it;s considered a security risk by some.
     
    theapparatus, Nov 2, 2009 IP
  8. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #8
    +1


    You'll most likely find that if you keep trying the fopen intermittently, it will eventually work. cURL might be better for this, but you'll get the same error. Just might be easier to check for a 503 and keep trying til you get some content.
     
    szalinski, Nov 2, 2009 IP
  9. jgalvez

    jgalvez Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    From the look of that error the problem was with the server you are trying to connect to, perhaps a problem with the connection from your host to that site. Also, it doesn't sound like your host has disabled that function or you would have gotten an error saying so.

    Beyond that, I definitely recommend the use of CURL instead of fopen when accessing remote URL's. Good luck!
     
    jgalvez, Nov 2, 2009 IP
  10. nice.wallpapers

    nice.wallpapers Active Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #10
    Hi , I think google blocked your server's IP address ... as your site is hitting google badly :)

    Thanks,
    >Harry
     
    nice.wallpapers, Nov 3, 2009 IP
  11. bemoi

    bemoi Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    i think the problem is from the server side, not google's side, as i tried it on another server and it worked like a charm, the funny thing is thats smetimes it shows and sometimes it doesn't, ill email dreamhost now and let you know the news
     
    bemoi, Nov 7, 2009 IP