Bug #51271 [Opn->Fbk]: CLI script + Sockets + Windows causes hang/pause at end of script execution

From: Date: Thu, 24 Oct 2013 08:11:33 +0000
Subject: Bug #51271 [Opn->Fbk]: CLI script + Sockets + Windows causes hang/pause at end of script execution
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182440@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=51271&edit=1

 ID:                 51271
 Updated by:         yohgaki@php.net
 Reported by:        funnymonkeybanana at gmail dot com
 Summary:            CLI script + Sockets + Windows causes hang/pause at
                     end of script execution
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            CGI/CLI related
 Operating System:   win32 only
 PHP Version:        5.2.13
 Block user comment: N
 Private report:     N

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------
[2010-03-11 02:45:51] funnymonkeybanana at gmail dot com

Description:
------------
I've experienced this problem for years but have never bothered to report it until now.  I
write a lot of command-line PHP scripts and I've found that scripts that do not attempt to open
a socket connection terminate immediately at the end of the program.  However, scripts that contact
remote (or even 'localhost') servers (i.e. open a socket during script execution) hang for
about 5 seconds before returning control to the command prompt.  I only experience this issue on
Windows machines.  Linux and OSX boxes seem unaffected.

Test script:
---------------
<?php
	file_get_contents("http://www.google.com/");
	echo "Hi!\n";
?>

Expected result:
----------------
Return to the command prompt as soon as the "Hi!" is output.

Actual result:
--------------
Reaches the end of the script (after displaying "Hi!") and simply hangs for 5 seconds or
so.


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=51271&edit=1


Thread (4 messages)

« previous php.bugs (#182440) next »