RE: [PHP] Unable to use fopen to read a URL - DNS Problem?
| From: | (Dave) | Date: | Wed, 22 Aug 2001 05:40:57 +0000 |
| Subject: | RE: [PHP] Unable to use fopen to read a URL - DNS Problem? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63855@lists.php.net to get a copy of this message | ||
check that apache is doing name resolution?? stab in the dark there.
can you do includes from other locations using names?
dns on the Ip address that apache/php is sitting on resolving correctly?
>-----Original Message-----
>From: Brian White [mailto:bwhite@steptwo.com.au]
>Sent: Tuesday, August 21, 2001 11:20 PM
>To: php-general@lists.php.net
>Cc: php-general@lists.php.net
>Subject: [PHP] Unable to use fopen to read a URL - DNS Problem?
>
>
>This is a repost.
>
>To summarise: My installtion of PHP is unable to resolve names. I can't use
>fopen
> to open a URL which uses a name, but if I manually calculate
>the IP
> address, I can read in the page OK. ( see example below ).
>
>I need some tips on where to start looking to solve this problem.
>
>If it helps, my config options when I built PHP were:
>
>--with-gd=/usr/local/src/gd-1.8.4/
>--enable-gd-imgstrttf
>--with-ttf=/usr/local/freetype/
>--enable-calendar
>--disable-short-tags
>--with-mysql=/usr/local/mysql/
>--with-jpeg-dir=/usr/local/src/jpeg-6b/
>--with-apxs=/usr/local/apache/bin/apxs
>
>and I am running PHP 4.0.4pl1 under Debian "Potato" Linux and Apache 1.3
>
>Regs
>
>Brian White
>
>At 16:28 14/08/2001 +1000, Brian White wrote:
>>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 33
>>
>>If, 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
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>>For additional commands, e-mail: php-general-help@lists.php.net
>>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>-------------------------
>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
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>