#27509 [Opn->Fbk]: fsockopen() failed with "Addr family not supported by protocol" error
| From: | pollita@php.net | Date: | Wed, 10 Mar 2004 23:42:19 +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-56264@lists.php.net to get a copy of this message | ||
ID: 27509
Updated by: pollita@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:
First off, thanks for being so patient and helpful. I'd like to ask
you to apply a small patch which introduces several debug watchpoints.
Then compile, run your test script, and post the results (they'll be a
bit on the verbose side).
http://169.229.135.175/test/27509-diff.txt
Previous Comments:
------------------------------------------------------------------------
[2004-03-10 16:23:39] scott at abcoa dot com
Oh I forgot! I did the "rm config.cache" and "make clean" before using
this configure line, "./configure --enable-sockets".
------------------------------------------------------------------------
[2004-03-10 16:20:52] scott at abcoa dot com
In response to sniper@php.net's comment... Removed the config.cache,
rebuild PHP with "./configure --disable-all --disable-cgi", ran the
test script using CLI and still get this same error message.
--snip--
!#/usr/local/bin/php
Warning: fsockopen(): unable to connect to www.google.com:80 in <<file
path omitted by me>> on line 6
66
Addr family not supported by protocol
--snip--
It had been observed that during most of those compilation using "make"
I saw this warning messages. I don't think this is related to socket
stuffs but thought you may would to know.
-snip--
gcc -Iext/standard/
-I/usr/local/src3/php4-STABLE-200403081230/ext/standard/ -DPHP_ATOM_INC
-I/usr/local/src3/php4-STABLE-200403081230/include
-I/usr/local/src3/php4-STABLE-200403081230/main
-I/usr/local/src3/php4-STABLE-200403081230
-I/usr/local/src3/php4-STABLE-200403081230/Zend
-I/usr/local/src3/php4-STABLE-200403081230/TSRM -O2 -c
/usr/local/src3/php4-STABLE-200403081230/ext/standard/file.c -o
ext/standard/file.o && echo > ext/standard/file.lo
/usr/local/src3/php4-STABLE-200403081230/ext/standard/file.c: In
function `zif_fgetcsv':
/usr/local/src3/php4-STABLE-200403081230/ext/standard/file.c:2308:
warning: passing arg 4 of `_php_stream_get_line' from incompatible
pointer type
/usr/local/src3/php4-STABLE-200403081230/ext/standard/file.c:2373:
warning: passing arg 4 of `_php_stream_get_line' from incompatible
pointer type
gcc -Iext/standard/
-I/usr/local/src3/php4-STABLE-200403081230/ext/standard/ -DPHP_ATOM_INC
-I/usr/local/src3/php4-STABLE-200403081230/include
-I/usr/local/src3/php4-STABLE-200403081230/main
-I/usr/local/src3/php4-STABLE-200403081230
-I/usr/local/src3/php4-STABLE-200403081230/Zend
-I/usr/local/src3/php4-STABLE-200403081230/TSRM -O2 -c
/usr/local/src3/php4-STABLE-200403081230/ext/standard/filestat.c -o
ext/standard/filestat.o && echo > ext/standard/filestat.lo
--snip--
In response to pollita@php.net's comment...
>>whether there are "lingering ghosts" of
>>the prior version.
Could be, I wouldn't deny it. The error message you saw in the
original report was the output from the website. The ./configure
command line was
--snip--
./configure --with-apache=../apache_1.3.27
--with-ibm-db2=/usr/lpp/db2_06_01 --with-openssl --with-mcrypt
--with-curl --without-mysql --enable-track-vars
--snip--
Since then, I found that I can produce this error through the CLI, so I
did away with the website and use CLI instead because it is alot
quicker to recompile than it is with PHP and webserver. Since then
there have been a numerous recompiling as instructed by this bug
report.
>>Can you confirm that you're still getting that
>>specific error message in your output?
I can confirm that the "php_hostconnect" does not exist anymore. I am
unable to reproduce this "php_hostconnect" error this time. I don't
remember what I did to make this happen. All I know is that it was as
result of fiddling around with the wording in the fsockopen()'s
parameter arguements to find out what work and what doesn't.
>>Of course, you'll need to ./configure --enable-sockets
>>in order to try these tests.
Okay, did the favor and recompile it with "./configure
--enable-sockets" configure line. Saw two warning messages, one from
above and other is
--snip--
gcc -Iext/sockets/
-I/usr/local/src3/php4-STABLE-200403081230/ext/sockets/ -DPHP_ATOM_INC
-I/usr/local/src3/php4-STABLE-200403081230/include
-I/usr/local/src3/php4-STABLE-200403081230/main
-I/usr/local/src3/php4-STABLE-200403081230
-I/usr/local/src3/php4-STABLE-200403081230/Zend
-I/usr/local/src3/php4-STABLE-200403081230/ext/xml/expat
-I/usr/local/src3/php4-STABLE-200403081230/TSRM -O2 -c
/usr/local/src3/php4-STABLE-200403081230/ext/sockets/sockets.c -o
ext/sockets/sockets.o && echo > ext/sockets/sockets.lo
/usr/local/src3/php4-STABLE-200403081230/ext/sockets/sockets.c: In
function `php_strerror':
/usr/local/src3/php4-STABLE-200403081230/ext/sockets/sockets.c:350:
warning: assignment makes pointer from integer without a cast
--snip--
Ran the sample test of the codes you posted, I included both by the
way. Ran it through the CLI and here's the response I got...
--snip--
Content-type: text/html
X-Powered-By: PHP/4.3.5RC4-dev
!#/usr/local/bin/php
resource(1) of type (Socket)
bool(true)
resource(2) of type (Socket)
bool(true)
--snip--
------------------------------------------------------------------------
[2004-03-10 14:03:57] pollita@php.net
I'm also concerned that you may not actually be testing against 4.3...
One of the error messages you noted in your original report
"php_hostconnect: connect failed in ..." only appears in PHP >prior< to
version 4.3.0. As of the 4.3 branch that message contains noticably
different text.
This discrepency doesn't necessary speak to the fact that the error is
occuring. But it raises a question as to whether there are "lingering
ghosts" of the prior version. Perhaps creating a conflict with 4.3
which leads to the emergence of the error.
Can you conirm that (after the copious number of recompiles you've been
asked for) you're still getting that specific error message in your
output?
It'd also be interresting to see if the sockets extension behaves in
the same way:
<?php
$socket = socket_create(AF_INET, SOCK_STREAM, 0);
var_dump($socket);
var_dump(socket_connect($socket, 'www.google.com', 80));
?>
or (for a slight variation:
<?php
$socket = socket_create(AF_INET, SOCK_STREAM,
getprotobyname("tcp"));
var_dump($socket);
var_dump(socket_connect($socket, 'www.google.com', 80));
?>
Of course, you'll need to ./configure --enable-sockets in order to try
these tests.
------------------------------------------------------------------------
[2004-03-10 13:21:47] sniper@php.net
Try this:
# rm config.cache ; ./configure --disable-all --disable-cgi
And use the CLI binary for testing.
------------------------------------------------------------------------
[2004-03-10 09:26:05] scott at abcoa dot com
The configure options I use are
--snip--
./configure --disable-ipv6
--snip--
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/27509
--
Edit this bug report at http://bugs.php.net/?id=27509&edit=1