ID: 36216 User updated by: ipmax at freesurf dot fr Reported By: ipmax at freesurf dot fr Status: Bogus Bug Type: Sockets related Operating System: debian PHP Version: 5.1.2 New Comment:
Right, same for me : ------------------------- ns55:~# time ./sapi/cli/php -r 'var_dump(fsockopen("sf.net", > 8060,&$errno,&$errstr,5));' -bash: ./sapi/cli/php: No such file or directory real 0m0.004s user 0m0.010s sys 0m0.000s ns55:~# time php -r 'var_dump(fsockopen("sf.net",8060,&$errno,&$errstr,5));' Warning: fsockopen(): unable to connect to sf.net:8060 (Connection timed out) in Command line code on line 1 bool(false) real 0m5.107s user 0m0.080s sys 0m0.020s ns55:~# time php -r 'var_dump(fsockopen("generation.elliptic.fr",8060,&$errno,&$ errstr,5));' resource(4) of type (stream) real 0m0.084s user 0m0.060s sys 0m0.020s ----------------------------------------- Does it mean, the problem is after the fsockopen ? Fsockopen reach host, so it says ok, but dont care if server send something back, then the feof stay stuck as it doesnt find EOF ? Maybe this is it ? in the : while(!feof($scfp)) {$page .= fgets($.... As you see my script, this one hangs in the while loop : <? $scfp=fsockopen("generation.elliptic.fr", 8060,&$errno,&$errstr,5); if(!$scfp) {echo "error"; exit; } else { echo "connected,"; fputs($scfp,"GET /admin.cgi\r\n\r\n"); while(!feof($scfp)) {$page .= fgets($scfp); } } fclose($scfp); ?> Previous Comments: ------------------------------------------------------------------------ [2006-01-31 14:40:14] [EMAIL PROTECTED] Host generation.elliptic.fr is alive and fsockopen() succeeds for me. But with that's what I get with sf.net, for example: # time ./sapi/cli/php -r 'var_dump(fsockopen("sf.net", 8060,&$errno,&$errstr,5));' Warning: fsockopen(): unable to connect to sf.net:8060 (Connection timed out) in Command line code on line 1 bool(false) real 0m5.257s user 0m0.007s sys 0m0.002s ------------------------------------------------------------------------ [2006-01-31 14:23:01] ipmax at freesurf dot fr Try this one, it reply connected, but hangs for ever. Tested on Debian and redhat. Same Result. $scfp=fsockopen("generation.elliptic.fr", 8060,&$errno,&$errstr,5); if(!$scfp) {echo "error"; exit; } else { echo "connected,"; fputs($scfp,"GET /admin.cgi\r\n\r\n"); while(!feof($scfp)) {$page .= fgets($scfp); } } fclose($scfp); ------------------------------------------------------------------------ [2006-01-31 12:32:54] [EMAIL PROTECTED] Works fine on different Fedora Core and SuSE versions, AIX, Solaris and FreeBSD, hence the problem is not in PHP itself, but somewhere in the underlying system libraries. Please report this issue to Debian developers. ------------------------------------------------------------------------ [2006-01-31 12:07:30] ipmax at freesurf dot fr thanks, i already got 5.1 i can't reinstall php now, but this bug as been reported many times, since years, so i dont think it is debug today. ------------------------------------------------------------------------ [2006-01-31 07:50:40] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip ------------------------------------------------------------------------ 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/36216 -- Edit this bug report at http://bugs.php.net/?id=36216&edit=1