title: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
body: <p>I'm trying to download an image from a server using a PHP script on my website on xampp server. </p>
  
  <p>The image is being downloaded using the function file_get_contents.</p>
  
  <p>The php code for downloading on the server is:</p>
  
  <pre><code>if(isset($_GET['path']) &amp;&amp; isset($_GET['username'])) {
      echo "path:".$_GET['path'];
      $temp = explode(".", $_GET['path']);
      $extension = end($temp);
      $fname="images/".$_GET['title'];
      $filenameIn  = $_GET['path'];
      $filenameOut = "" . $fname;
      $contentOrFalseOnFailure   = file_get_contents($filenameIn);
      $byteCountOrFalseOnFailure = file_put_contents($filenameOut,$contentOrFalseOnFailure);
  }
  </code></pre>
  
  <p>But I'm getting this error: </p>
  
  <blockquote>
    <p>Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in
    /opt/lampp/htdocs/xampp/project/upload_art.php on line 19</p>
    
    <p>Warning: file_get_contents(<a href="http://app6.pixlr.com/_temp/528afa6e2f7cc6a5b1000101.jpg" rel="noreferrer">http://app6.pixlr.com/_temp/528afa6e2f7cc6a5b1000101.jpg</a>):
    failed to open stream: php_network_getaddresses: getaddrinfo failed:
    Name or service not known in
    /opt/lampp/htdocs/xampp/project/upload_art.php on line 19</p>
  </blockquote>
  
  <p>I have checked out all posted answers here but none seems to resolve the issue. Please help!</p>