Unable to download XML file on server, works fine on other
<p>I have had an application running successfully for a couple months that relies on a cron job to get an xml feed of air pollution statistics. Since January it has run without error, but this morning from 7:00 it has not read the data. The relevant code is as follows:</p>

<pre><code>&lt;?php
define('FEED_URL', 'http://www.beijingaqifeed.com/BeijingAQI/BeijingAir.xml');
$contents = file_get_contents(FEED_URL);
if ($contents === false) echo "READ FAILED";
echo "FILE_GET_CONTENTS SIZE IS " . strlen($contents) . "&lt;br&gt;\n";
</code></pre>

<p>If I run this on my machine at home, it works:</p>

<pre><code>FILE_GET_CONTENTS SIZE IS 21538
</code></pre>

<p>If it runs on my server it does not:</p>

<pre><code>FILE_GET_CONTENTS SIZE IS 0
</code></pre>

<p>I have confirmed with support at the server site that they can browse the url and see the xml data, so there is no firewall or anything blocking this. And, as I say, this has worked successfully over 1000 times (as measured by entries in my database) until this morning, and now it always fails. I have no connection at the data supplier so I can't investigate from their side. </p>

<p>Can anyone suggest why this started failing, and what I could try doing? I have tried fread() and file(), with the same results. </p>

<p>Thanks...</p>

<p>(I have checked allow_url_fopen is turned on)</p>
