ID: 27509 Comment by: scottmacvicar at ntlworld dot com Reported By: scott at abcoa dot com Status: Open Bug Type: Sockets related Operating System: AIX 4.3.3 PHP Version: 4.3.4 New Comment:
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? Previous Comments: ------------------------------------------------------------------------ [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