PHP file_get_contents() error please help

Discussion in 'PHP' started by shobankr, Apr 8, 2008.

  1. #1
    Hi

    I am trying to fetch the contents of a pge using file_get_contents().

    The page lies on a different server and I have to pass some values as query string.

    There is a page in my server which calls this page and converts the return text to some friendly messages and displays them.

    This setup works perfectly in my machine but fails with my hosting server.
    When I try to run the page www.xxx.com/x.php (this is the page which calls the remote file)

    The error I get is :page not found".... Any idea?

    server : PHP version 5
    local : php version 5
     
    shobankr, Apr 8, 2008 IP
  2. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #2
    could be permissions problem with your server. check it
     
    olddocks, Apr 9, 2008 IP
  3. shobankr

    shobankr Peon

    Messages:
    162
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks mate.. i checked the server and it does allow call to other domain URL...

    I checked file_get_contents for other site an it works fine... This particular URL does not respond. But it works perfectly fine in my local machine....
     
    shobankr, Apr 9, 2008 IP
  4. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #4
    did you try fopen() with allow_url_fopen is enabled.
     
    olddocks, Apr 9, 2008 IP
  5. shobankr

    shobankr Peon

    Messages:
    162
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes.. I did!! And it failed for this URL
    .... I tried redirection to this URl and that works perfectly which means the server is not firewalled!!!

    :(
     
    shobankr, Apr 9, 2008 IP