title: file_get_contents not working for local files, same issue with cURL
body: <p><strong>The problem:</strong></p>
  
  <p><code>file_get_contents('http://google.com');</code> works fine (works for any external url)</p>
  
  <p><code>file_get_contents('http://my.server.org/existing_file.php');</code> returns nothing, and <code>var_dump($http_response_header);</code> returns an empty array when loading any local url.</p>
  
  <p>I get the same empty response using 127.0.0.1 and localhost in place of the domain name.</p>
  
  <p><strong>I've tried/checked:</strong></p>
  
  <p>I've tried using <code>cURL</code> instead as <a href="https://stackoverflow.com/questions/3457692/file-get-contents-not-working-for-local-files">suggested here</a> - I get the same result (works for external URLs, empty response for local).</p>
  
  <p><code>allow_url_fopen=On</code> and <code>cURL</code> is enabled in <code>php.ini</code> according to <code>phpinfo()</code> - this must be ok, as I can load external URLs without a hitch.</p>
  
  <p>I cannot use <code>include</code> instead, as I need to load a URL with variables to pass to a PDF renderer. 
  Is there some other php.ini setting that needs to change? Or could it be some other problem? I think it is a configuration issue because my code works fine locally in MAMP, but not on the production server.</p>
  
  <p><strong>Why I am doing this at all:</strong></p>
  
  <p>It's all tied up in a Wordpress <code>functions.php</code> file - I'm basically loading a url like <code>http://my.server.org/path/to/file/?pdf-template</code>, which I then check against the path to load the correct rendering template, which then feeds the <em>rendered</em> php to <a href="http://pxd.me/dompdf/www/examples.php" rel="nofollow noreferrer">DOMPDF</a> to generate a PDF file on the fly. Ultimately it means the client can append <code>/pdf/</code> to any url in their wordpress site and get a PDF version.</p>
  
  <p>What's odd is that this used to work fine on their server, and the person in charge of the server at the client says nothing has changed with the configuration. They <em>have</em> changed webhost in the last month though, which probably has something to do with it. </p>
  
  <p><strong><em>Update</em></strong></p>
  
  <p>I managed to pull this from the error log</p>
  
  <p><code>Notice: file_get_contents(): send of 2 bytes failed with errno=104 Connection reset by peer in /home/path/to/my/file.php on line 19</code></p>
  
  <p>The problem also appears to be intermittent - <em>sometimes</em> <code>file_get_contents</code> works, sometimes it fails with the above error. There doesn't seem to be a pattern.</p>
  
  <p>Could this be a firewall problem?</p>