ID: 39803 User updated by: marcelo at tpn dot com dot br Reported By: marcelo at tpn dot com dot br -Status: Feedback +Status: Open Bug Type: Sockets related Operating System: FreeBSD 5.3 PHP Version: 4.4.4 New Comment:
I'm using PHP 4.4.4, not PHP 5. network.c has two pieces that uses EINPROGRESS: if ((n = connect(sockfd, addr, addrlen)) < 0) { if (errno != EINPROGRESS) { return -1; } } if (ret == -1 && error == EINPROGRESS) { error = 0; goto retry_again; } Where should I put "if (error == EINPROGRESS) error = 0;" ? Previous Comments: ------------------------------------------------------------------------ [2006-12-12 16:32:18] [EMAIL PROTECTED] Does the fix from http://bugs.php.net/bug.php?id=38568 work for you? ------------------------------------------------------------------------ [2006-12-12 16:19:34] marcelo at tpn dot com dot br Yes, I've disabled my firewall. I'm sure that isn't a firewall problem. The problem doesn't depend the hostname or IP address. I got the same error trying to connect to localhost, 127.0.0.1, 10.0.0.9 (internal network) This also didn't work: <?php $fp = fsockopen("127.0.0.1", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)\n"; } ?> This also didn't work (connect to an internal server): <?php $fp = fsockopen("10.0.0.9", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)\n"; } ?> But I can use socket_connect without problems. Example: <? $sockHttp = socket_create(AF_INET, SOCK_STREAM, 0); if (!$sockHttp) { die('socket_create() failed!'); } $resSockHttp = socket_connect($sockHttp, "10.0.0.9", 80); if (!$resSockHttp) { die('socket_connect() failed!'); } ?> I also can use "fetch" utility to get data from these servers. I also wrote a PERL script, and it worked. I also type in prompt "telnet 127.0.0.1 80", "telnet www.google.com 80", the connection was sucessfull. Only while I'm using fsockopen I got errors, always error returns 36 and error string returns "Operation now in progress". ------------------------------------------------------------------------ [2006-12-12 15:42:40] [EMAIL PROTECTED] >I believe that if the code is the same, should produce the > same result, else there is a bug. No, it most likely means that it has nothing to do with this code and you're looking for a problem in wrong place. Have you already disabled your firewall? ------------------------------------------------------------------------ [2006-12-12 15:22:51] marcelo at tpn dot com dot br I don't understand. If worked with CGI but not as an Apache Module, why you don't consider this a bug? I believe that if the code is the same, should produce the same result, else there is a bug. ------------------------------------------------------------------------ [2006-12-12 14:22:58] [EMAIL PROTECTED] Both CGI and Apache module share the same code for fsockopen(), so fsockopen() doesn't depend on the Server API used. ------------------------------------------------------------------------ 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/39803 -- Edit this bug report at http://bugs.php.net/?id=39803&edit=1