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

Discussion in 'PHP' started by mrkool, Oct 20, 2009.

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

    Warning: file() [function.file]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/content/......  on line 242
    
    Code (markup):
    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;
     
    Last edited: Oct 20, 2009
    mrkool, Oct 20, 2009 IP
  2. GDHosting

    GDHosting Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mrkool,

    If you're running PHP 5, name your initialization file php5.ini. Make sure you upload the initialization file to the root directory of your site.
     
    GDHosting, Oct 20, 2009 IP
  3. mrkool

    mrkool Active Member

    Messages:
    261
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    85
    #3
    I have already name the file php5.ini and was uploaded at the root directory.
     
    mrkool, Oct 21, 2009 IP