|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51271 CLI script + Sockets + Windows causes hang/pause at end of script execution
Submitted: 2010-03-11 02:45 UTC Modified: 2014-12-30 10:41 UTC
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: funnymonkeybanana at gmail dot com Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.2.13 OS: win32 only
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: funnymonkeybanana at gmail dot com
New email:
PHP Version: OS:


 [2010-03-11 02:45 UTC] funnymonkeybanana at gmail dot com
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:
	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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-11 21:09 UTC]
-Operating System: Windows XP Professional SP3 +Operating System: win32 only
 [2013-10-24 08:11 UTC]
-Status: Open +Status: Feedback
 [2013-10-24 08:11 UTC]
Please try using this snapshot:
For Windows:

 [2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 22 20:03:59 2023 UTC