Re: file url access funniness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, TR Shaw

I would next try curl as php-extension.
If that is working well, and you need it definitely with file() I'd use
Wireshark to check which request is sent to the remote machine.

Bye
Simon

2012/3/10 TR Shaw <tshaw@xxxxxxxx>

> 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
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux