fopen fails with getaddrinfo failed
<p>I am having problems with the following code:</p>

<blockquote>
<pre><code>function http_file_exists($url){
$f=fopen($url,"r");
if($f){
    fclose($f);
    return true;
} else {
  return false;
}
</code></pre>
  
  <p>} 
  $url = "http://www.minhemmelighed.dk/Graphics/Products/55.jpg";</p>
  
  <p>print http_file_exists($url);</p>
</blockquote>

<p>The error it returns is: </p>

<blockquote>
  <p>Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /srv/http/webshop3/image_scraper/test.php on line 6 Warning: fopen(http://www.minhemmelighed.dk/Graphics/Products/55.jpg): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /srv/http/webshop3/image_scraper/test.php on line 6</p>
</blockquote>

<p>What can I do about this? I have rebooted the server several times.</p>

<p>For the record:</p>

<p>I can access the website in question through a browser</p>

<p>I am running LAMP on Arch Linux</p>
