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:
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); Previous Comments: ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ [2006-01-31 04:52:12] ipmax at freesurf dot fr You can delete previous post, here is a good example : This echo "connected," and hangs for ever, timout doesnt works : --------------------------------- $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); ////////////////////// This works, considering timout is checked in the fgets loop. stream_set_timeout() replace the bug of fsockopen that doesnt timeout. $scfp=fsockopen("generation.elliptic.fr", 8060,&$errno,&$errstr,2); if(!$scfp) {echo "error"; exit; } else { echo "connected,"; stream_set_timeout($scfp,2); fputs($scfp,"GET /admin.cgi\r\n\r\n"); while(!feof($scfp)) {$page .= fgets($scfp); $info = stream_get_meta_data($scfp); if ($info['timed_out']) { echo "timeout"; exit; } } fclose($scfp); --------------------- PHP 5.1.1-1.dotdeb.2 (cli) (built: Dec 1 2005 12:46:40) ------------------------------------------------------------------------ [2006-01-31 04:50:58] ipmax at freesurf dot fr Please use this adress to test : $scfp=fsockopen("generation.elliptic.fr", 8060,&$errno,&$errstr,1); I dont know what firewall there is, but sometimes, my demo is correct, on microsoft it is not. ------------------------------------------------------------------------ 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