ID:               27509
 User updated by:  scott at abcoa dot com
 Reported By:      scott at abcoa dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Sockets related
 Operating System: AIX 4.3.3
 PHP Version:      4.3.4
 New Comment:

Here's the response I got...  It's also the same with the host,
"www.example.com" instead of "www.google.com".



--snip--

Content-type: text/html

X-Powered-By: PHP/4.3.5RC4-dev



!#/usr/local/bin/php



getaddresses

  GETADDRINFO method

  defaulting to AF_INET(2)  hints.ai_family = 0

  got result

    sai->ai_family = 2

  returning from getaddresses: n = 1

php_network_getaddresses returned 1

Creating socket of type 0 (AF_INET = 2)

  socket() returned: -1

<br />

<b>Warning</b>:  fsockopen(): unable to connect to www.google.com:80 in
<b>/home/website/emarket/test_fsockopen_shell.sh</b> on line
<b>6</b><br />



66



Addr family not supported by protocol

--snip--


Previous Comments:
------------------------------------------------------------------------

[2004-03-11 13:12:03] [EMAIL PROTECTED]

Sorry, I wanted you to run a test with fsockopen(), not the socket_*
extension.  (Believe it or not they're completely different
implementations even though they do the same thing)



<?php

  $fp = fsockopen('www.exmaple.com', 80);

?>



Please run that one against the version you've already patched and
compiled.

------------------------------------------------------------------------

[2004-03-11 10:54:40] scott at abcoa dot com

Not a  problem!  Been wanting the fsockopen() to work, so my company's
website can function once again.  



Applied the patch and went through the programmer's ritual (compiling)
all over again.  Out came the result, believe it or not, it's the same
end result.   



--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--



Look like the four functions, "php_host_connect(***)", 

"php_network_getaddress(***)", "php_connect_nonb(***)" and 

"dump_stock_state(***)" wasn't reached and executed.



I did open up the network.c and 27509-diff.txt with the editor and
check to see if the patch was applied correctly and I can confirm that
the patch was insteed applied.  :-(

------------------------------------------------------------------------

[2004-03-10 18:42:19] [EMAIL PROTECTED]

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

------------------------------------------------------------------------

[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 [EMAIL PROTECTED]'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 [EMAIL PROTECTED]'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--

------------------------------------------------------------------------

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

Reply via email to