Results 1 to 8 of 8
  1. #1
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default File_Get_Contents Error.

    Hey,
    From time to time, this error comes up using the file_get_contents function

    Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/****/public_html/user/func.php on line 11


    Does anyone know how to bypass this error/know whats causing it/suggest a function that wont cause this error but does the same job?

    Thanks for any helpful input

    Craig.
    Coming and going...
    Highers are getting the better of me

  2. #2
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default

    Try the IP instead of the domain. (In the function)

  3. #3
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    The IP would just link to pycan site..
    Coming and going...
    Highers are getting the better of me

  4. #4
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by MrCraig View Post
    The IP would just link to pycan site..
    I was tinkering with file get contents a few day's ago..

    and it had a function to echo so many bytes.. if you've done

    file_get_contents('http://www.somesite.com/pages/lol.php');

    I don't believe that would work.

    http://us2.php.net/file_get_contents

    <?
    $content=file_get_contents("http://www.google.com",FALSE,NULL,0,20);
    echo $content;
    ?>

    Would work I believe.

  5. #5
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Hasnt made any difference :S

    Any other suggestions?
    Coming and going...
    Highers are getting the better of me

  6. #6
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    It's not a PHP error, it's a DNS one. Ask your host to ping the site you're trying to use f_g_c() on and if it can't ping the url, then that's your problem.

  7. #7
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default

    Whenever this has happened to me before Ive used the IP, like say my hosts IP was 127.0.0.1 I'd do

    file_get_contents("http://127.0.0.1/~myaccountname/php/files/uberleethaxorfile.htm");

  8. #8
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Well its only happening on one site that its being used on..

    So i dont know if its the server that the sites ons problem..

    And robbie, that works

    So i will probably switch to using that method.
    Coming and going...
    Highers are getting the better of me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •