If you are getting a message saying that downloading the file failed because of server configuration, then comment out the following line:
$file = file_get_contents($url);
Above it, paste the following code:
// Download file
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, 0); // ignore any headers
ob_start(); // use output buffering so the contents don't get sent directly to the browser
curl_exec($curl); // get the file
curl_close($curl);
$file = ob_get_contents(); // save the contents of the file into $file
ob_end_clean(); // turn output buffering back off