From: trutas dot ctx at gmail dot com Operating system: Windows Server 2003 x64 IIS6.0 PHP version: 5.3.0 PHP Bug Type: IIS related Bug description: fgets hangs on fsockeopen stream
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...
--
Edit bug report at http://bugs.php.net/?id=48946&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48946&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48946&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48946&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48946&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48946&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48946&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48946&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48946&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48946&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48946&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48946&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48946&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48946&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48946&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48946&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48946&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48946&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48946&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48946&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48946&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48946&r=mysqlcfg
