SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru rashidr's Avatar
    Join Date
    Jun 2004
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error: php_network_getaddresses: getaddrinfo failed: Name or service not known

    All was working fine till today, but suddenly I am getting this error today.

    Code:
    Warning: file() [function.file]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/content/...... on line 242
    I am using GoDaddy hosting
    PHP Ver is 5.
    In php.ini allow_url_fopen = on


    Can anyone guide me where i am getting wrong.

    Here is the actual php code:

    $GrabURL = $id;

    $GrabStart = '<span id="intelliTxt">';
    $GrabEnd = '<div id="fbconnect">';
    $file = file($GrabURL);

    $contents = '';

    foreach($file as $num=>$line)
    {
    if(stristr($line,$GrabStart)) {
    $start = $num;
    }
    if($start)
    {

    $contents .= $line;
    }

    if(stristr($line,$GrabEnd)) {
    break;
    }

    }
    echo $contents;

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you access the URL from the command line? (using wget or curl)

    This might not be a PHP problem at all.

  3. #3
    SitePoint Guru rashidr's Avatar
    Join Date
    Jun 2004
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can access the url from browser. It seems everything working now.


Bookmarks

Posting Permissions

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