file url access funniness
| From: | TR Shaw | Date: | Sat, 10 Mar 2012 16:51:15 +0000 |
| Subject: | file url access funniness | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-316965@lists.php.net to get a copy of this message | ||
This is weird. This statement fails:
$tlds = file("http://www.surbl.org/tld/three-level-tlds",
FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
Warning: file(http://www.surbl.org/tld/three-level-tlds): failed to open stream: HTTP request
failed! HTTP/1.0 502 Bad Gateway
also tried the final location and it fails with:
Warning: file(http://george.surbl.org/two-level-tlds): failed to open stream: HTTP request failed!
But a browser and the following work:
$response = shell_exec("curl -s -S -L http://data.iana.org/TLD/tlds-alpha-by-domain.txt
-o tlds-alpha-by-domain.txt");
Any ideas? I'd rather not use curl if possible.
TIA,
Tom