#27509 [Opn->Fbk]: fsockopen() failed with "Addr family not supported by protocol" error
| From: | wez@php.net | Date: | Mon, 08 Mar 2004 16:52:38 +0000 |
| Subject: | #27509 [Opn->Fbk]: fsockopen() failed with "Addr family not supported by protocol" error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56112@lists.php.net to get a copy of this message | ||
ID: 27509
Updated by: wez@php.net
Reported By: scott at abcoa dot com
-Status: Open
+Status: Feedback
Bug Type: Sockets related
Operating System: AIX 4.3.3
PHP Version: 4.3.4
New Comment:
Are you 100% sure you made a clean build after reconfiguring php ?
(make clean ; make)
If yes, please try building latest php5 snapshot as a cli to test your
script; it has some runtime intelligence to detect systems with broken
network stacks.
Previous Comments:
------------------------------------------------------------------------
[2004-03-08 10:06:30] scott at abcoa dot com
In reply to the 3 comments since my last reply.
1) Excuse my typo, so tried again on the tcp with "//" and got an errno
with "0" and errstr with "Error 0". The fsockopen() instruction at
php.net showed that this meant an error had occur before the
fsockopen(). So, tried the "127.0.0.1" without the "tcp://" and got
the original error, with "66" and "Addr family not supported by
protocol". You know, I did this one test by using the terminal
emulator and use the telnet command, "telnet www.google.com 80" and was
able to connected successfully and receive data from it.
2) Recompiled the latest CVS snapshot and still get the same error
message.
3) Again, recompiled the latest CVS snapshot with "--disable-ipv6"
option and still get this same error message.
Now I'm a little concern about how much of a time will be spend on this
or whether would this be dragged on like months and months or
something.
Scott
------------------------------------------------------------------------
[2004-03-06 16:35:08] wez@php.net
If that doesn't work, try configuring PHP using
--disable-ipv6
------------------------------------------------------------------------
[2004-03-06 13:29:13] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-03-05 18:16:39] scottmacvicar at ntlworld dot com
Should be tcp:// not tcp:\\ since \ is an escape character and will end
up being evaluated to tcp:\
How about a local IP do they work?
------------------------------------------------------------------------
[2004-03-05 17:59:13] scott at abcoa dot com
Description:
------------
I had no trouble with the fsockopen() until I upgraded to PHP 4.3.4.
My last working version was 4.2.3 before the upgrade. It sure look
like a fsockopen() issue. Enclosed below is the source code that
produce the same error result with both the Apache/Browser and the
Shell Environment. I tried variety of URL Address and still get the
same result, like www.google.com, www.cnn.com, www.php.net, etc...
Been trying different ways with the scripts, machine and network and
yet get the same result. I tried with and without the "tcp:\\" and
still get the same result. (One more thing, could error 66 meant 6
with an one digit, not two??)
Reproduce code:
---------------
<?
//fsockopen("tcp:\\www.google.com",80,$errno,$errstr,30);
fsockopen("www.google.com",80,$errno,$errstr,30);
echo "\n\n";
echo $errno."\n\n";
echo $errstr."\n\n";
?>
Expected result:
----------------
Should expect to see an successful connection to www.google.com
Actual result:
--------------
Warning: fsockopen() [http://www.php.net/function.fsockopen]:
php_hostconnect: connect failed in <<file path omitted by me>> on line
5
Warning: fsockopen() [http://www.php.net/function.fsockopen]: unable to
connect to www.google.com:80 in <<file path omitted by me>> on line 5
66
Addr family not supported by protocol
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27509&edit=1