|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-07-23 22:59 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Description: ------------ fgets() hangs up to script timeout (60secs) on an opened fsockopen stream. stream_set_timeout is set for 30 secs - but apparently does nothing. For now i'll try to work around it using curl and the intranet squid proxy server. Reproduce code: --------------- $fp = fsockopen("intranet.mydomain.net", 443, $errno, $errstr, 30); if($fp) { if(fputs($fp, $headers, strlen($headers))){ $result = ''; stream_set_timeout($fp, 30); //should timeout in 30 secs while(!feof($fp)) { $result .=fgets($fp, 4096); //scripts hangs up to script timeout in this line } fclose($fp); print $result; } } Expected result: ---------------- $result gets printed or error gets thrown out somewhere. Actual result: -------------- Maximum execution time of 60 seconds exceeded in...