PHP fopen error

Discussion in 'PHP' started by ianlufc, Jan 16, 2008.

  1. #1
    Guys im using this line

    $fp = fopen ($file, "r") or die ("Could not open $file for input");

    and im getting this error
    Warning: fopen(http://www.nytimes.com/services/xml/rss/nyt/Books.xml) [function.fopen]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Users\Ian\Documents\College\BSHSS\BSHSS4\server2go\htdocs\projectBookstore\rssParserTester.php on line 149
    Could not open http://www.nytimes.com/services/xml/rss/nyt/Books.xml for input


    ANY IDEA'S
     
    ianlufc, Jan 16, 2008 IP
  2. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Have you tried calling fopen() on other URLs? Is it a problem with all of them or with this one in particular?
     
    SmallPotatoes, Jan 16, 2008 IP
  3. ianlufc

    ianlufc Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    All of them mate
     
    ianlufc, Jan 16, 2008 IP
  4. jmf000

    jmf000 Peon

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Check internet connection.
    try from command line on server
    
    telnet www.nytimes.com 80
    
    Code (markup):
    it's possible outbound conections are blocked.
     
    jmf000, Jan 16, 2008 IP
  5. shyju

    shyju Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it is workin fine here
    <?php
    $file='http://www.nytimes.com/services/xml/rss/nyt/Books.xml';
    $fp = fopen ($file, "r")
    ?>
     
    shyju, Jan 16, 2008 IP
  6. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #6
    Check your firewall
     
    wmtips, Jan 16, 2008 IP