Results 1 to 5 of 5
  1. #1

    getaddrinfo failed error

    On my site I have a script that displays random quotes and messages.
    It used to work fine for over 3 years but for the past two weeks I keep getting the following errors which show up randomly and if you refresh the site the script might work fine again.

    Warning: main(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/httpd/vhosts/domain/httpdocs/index.php on line 76

    Warning: main( failed to open stream: Resource temporarily unavailable in /home/httpd/vhosts/domain/httpdocs/index.php on line 76
    At first, the script was setup to open up a small text file and display the text which it contained. The person who hosts the site for me suggested that instead of opening the file I should try a php array. So I did that and I still get the error that I posted above. The error seems to be intermittant.

    I have also been told that the /tmp/ directory has been cleared. But that didnt resolve the problem.

    Does anyone know what this error means and how to fix it?
    Last edited by webzila; 06-19-2005 at 02:17 PM.

  2. #2
    Join Date
    Aug 2004
    Sydney, Australia
    That means your server is unable to communicate with when you get that error.

    It could be a:

    - DNS problem
    - Network problem
    - Firewall
    Net Logistics Web Hosting - Solutions Through Innovation

  3. #3
    In this case '' is located on the server which is trying to contact it. A friend of mine is hosting the site on his dedicated server. Would the reasons that you specified still apply?

    Actually, it was only today that I changed the include() to use a full URL. Prior to that I was using a relative address so it didnt even include in it.

    I am guessing its some sort of a server problem, I just dont know what. Although when contacting the host (its a managed server) they say that this must be a temporary problem and just wait to see if it happens again...but it was explained that its intermmitent and has been occuring for the past 2-3 weeks.


  4. #4
    Join Date
    Aug 2004
    Sydney, Australia
    What are your include paths? What happens when you ping from shell?
    Net Logistics Web Hosting - Solutions Through Innovation

  5. #5
    I am not sure I am giving you the right info. Correct me if I am wrong. I think the include path is:
    include_path .:/usr/share/pear

    I dont have access to shell right now so I cant ping the site. Pinging it from my pc I get 4 replies. Also I have a ping script on my site which pings a host from the server (where my site is located) and I get all replies.

    To get the quotes I use the following code right now:
    <?php include "";?>

    Prior to utilizing a php script which uses an array to store the quotes I was using the following script to pull the text out of a file and periodically I would get the same error.

    $font ="Verdana";
    $fontsize ="2";
    $textfile ="";
    echo "<font face=\"$font\" size=\"$fontsize\">";
    $quotes = file("$textfile");
    $quote = rand(0, sizeof($quotes)-1);
    echo $quotes[$quote];
    echo "</font>";

Posting Permissions

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