You also don't need to [man]fread/man or [man]fclose/man - [man]file/man returns an array containing the stream's contents, not a stream resource. So you shouldn't be trying to fread() or fclose() it.
Also, if it's working - just with errors - and you have Zend's optimiser - use @file() instead of file() to get around with a bug in Zend's product.
Thirdly - well, as drew010 asks, does the URL even refer to a valid resource?