Problem with fopen url wrapper
| From: | Richard Heyes | Date: | Tue, 19 Dec 2000 14:45:35 +0000 |
| Subject: | Problem with fopen url wrapper | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31039@lists.php.net to get a copy of this message | ||
Got php4.03pl1 installed on RHL6.2 with Apache 1.3.12 and am having
intermittent difficulties with fopen'ing urls. When issuing the fopen() call
it will hang for a couple of minutes. Network access for other stuff on the
same machine is fine, eg a perl script doing a similar thing with socket
functions (socket/connect (?) ) works great. I've done an strace like so:
strace php -q test.php
Where test.php is this:
$fp = fopen('http://yahoo.com/', 'r');
fclose($fp);
It seems to hang at a poll() function:
...
close(3) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sin_family=AF_INET, sin_port=htons(53),
sin_addr=inet_addr("192.168.10.1")}}, 16) = 0
send(3, "0P\1\0\0\1\0\0\0\0\0\0\5yahoo\3com\0\0\34\0\1", 27, 0) = 27
time(NULL) = 977234104
poll(
Which then repeats.
For whatever reason, using IP addresses seems to work most of the time, but
not always (yahoo.com for example).
TIA for any help!
--
Richard Heyes