Using fopen to read a URL - DNS Problem?
| From: | Brian White | Date: | Tue, 14 Aug 2001 06:28:20 +0000 |
| Subject: | Using fopen to read a URL - DNS Problem? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62579@lists.php.net to get a copy of this message | ||
The following code:
$url = "http://www.php.net/";
print ( implode( "", file( $url ) ));
causes my browser to sit and twiddle it's thumbs for ages and then produce:
Warning: file("http://www.php.net/") - Bad file descriptor in myfile.php on line 33
Warning: Bad arguments to implode() in myfile.php on line 33If, however, I explictly use the IP address:
$url = "http://208.247.106.187/"; print ( implode( "", file( $url ) ));it will successfully dump a copy of the php front page. This says to me that PHP can't resolve names. It is not a problem with the linux box it's running on, given that I ran "ping www.php.net" on that particular box to find the IP address. Can anyone tell me what I need to do to make it work? Regs Brian White ------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: bwhite@steptwo.com.au