Try changing https to http - it will still beable to get the file and I've found php sometimes struggles to make a https connection.
As retail-therapy said, it could also be allow_url_fopen, but I thought that gave a different error. To set it just add: -
PHP Code:
ini_set('allow_url_fopen','1');
before the $handle = fopen... line.