title: PHP Warning: file_get_contents
body: <p>So 2 days ago I got this message:</p>
  <blockquote>
  <p>PHP Warning: file_get_contents(<a href="http://example.com" rel="nofollow noreferrer">http://example.com</a>): failed to open stream: Connection timed out in /home/server/map/index.php on line 30</p>
  </blockquote>
  <p>This is what I've on line 29 and 30:</p>
  <pre><code>$url = 'http://example.com';
  
  $string = file_get_contents($url);
  </code></pre>
  <p>The fun part is that I can see the external content on my local host. But not when I upload it to the server. Then I can only see the html + css included in the index.php file.</p>
  <p>What I'm trying to do is to get all the available objects from the external website and post them on my website.</p>
  <p>I've done it with a several other pages. But now encountered problems with some of them.</p>
  <p>Anyone here who has any exemepl on how I can solve it with php.
  Possibly a completely different solution?</p>