Function file_get_content don't work occasionally
<p>When I am using a <code>file_get_content</code> to download result of php script execution:</p>

<pre><code>    //mainfile.php
    $ctx = stream_context_create(array(
        'http' =&gt; array(
            'timeout' =&gt; $this-&gt;cfg['gp_timeout']/2
            )
        )
    );
    $url_xml='http://test.server.eu/webgatescript.php?getphoto&amp;param1=1&amp;test=1&amp;param2=2&amp;param3=3';
    $webgateResponse=file_get_contents($url_xml,false,$ctx);
</code></pre>

<p>As I know, function <code>file_get_content</code> returns <code>string</code> - content of file, if file is not exist returns <code>FALSE</code>.</p>

<p>From time to time function <code>file_get_content</code> returns <code>FALSE</code>, despite I am in 100% sure that remote file returned content (xml file in my case, I have access and logs). Furthermore <code>file_get_content</code> returns <code>FALSE</code> few microsecond after end of execution remote script, but it takes less time then timeout was setted.</p>

<p>Part of logs:</p>

<pre><code>10:22:04&lt;?xml version="1.0" encoding="UTF-8"?&gt;
10:22:16&lt;response&gt;&lt;htlName/&gt;&lt;lang/&gt;&lt;texts/&gt;&lt;/response&gt;
10:22:46&lt;?xml version="1.0" encoding="UTF-8"?&gt;
10:22:58&lt;response&gt;&lt;htlName/&gt;&lt;lang/&gt;&lt;texts/&gt;&lt;/response&gt;
10:23:28&lt;?xml version="1.0" encoding="UTF-8"?&gt;
10:23:29&lt;response&gt;&lt;htlName/&gt;&lt;lang/&gt;&lt;texts/&gt;&lt;/response&gt;
10:23:59&lt;?xml version="1.0" encoding="UTF-8"?&gt;
10:23:59&lt;response&gt;&lt;htlName/&gt;&lt;lang/&gt;&lt;texts/&gt;&lt;/response&gt;
10:24:29&lt;?xml version="1.0" encoding="UTF-8"?&gt;
10:24:29&lt;response&gt;&lt;htlName/&gt;&lt;lang/&gt;&lt;texts/&gt;&lt;/response&gt;

Warning: file_get_contents(http://test.server.eu/webgatescript.php?getphoto&amp;param1=1&amp;test=1&amp;param2=2&amp;param3=3): failed to open stream: HTTP request failed!  in /home/www/mainfile.php on line 22

Call Stack:
    0.0002      93616   1. {main}() /home/www/mainfile.php:0
      175.5346     109072   2. file_get_contents(string(172), bool, resource(14) of type     (stream-context)) /home/www/mainfile.php:22

10:24:5910:25:46&lt;?xml version="1.0" encoding="UTF-8"?&gt;
10:25:47&lt;response&gt;&lt;htlName/&gt;&lt;lang/&gt;&lt;texts/&gt;&lt;/response&gt;
</code></pre>

<p>I made some tests, one of them was running file <code>mainfile.php</code> in <code>exec</code> (I have both files on this same test server, but on production server that will be two separated systems)</p>

<pre><code>    exec("php webgatescript.php &gt;&gt; tom2.log");
</code></pre>

<p>and everyone case of running <code>webgatescript.php</code> is logging.</p>
