|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17964 socket fclose CLOSE_WAIT
Submitted: 2002-06-25 05:37 UTC Modified: 2002-07-01 17:33 UTC
Avg. Score:4.4 ± 0.8
Reproduced:8 of 8 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (25.0%)
From: filippo at zirak dot it Assigned:
Status: No Feedback Package: Sockets related
PHP Version: 4.2.1 OS: linux 2.4.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-06-25 05:37 UTC] filippo at zirak dot it
$fp=fopen("", $myport, 3);
... (actions)

if the server does not close itself the connetion, but is the php client to close it with fclose, this leads invariably to leave the server connection in a CLOSE_WAIT state (for looooong time, not secs!).



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-25 05:42 UTC]
Can you please try the latest non-stable snapshot from, it is likely that this is fixed already.

 [2002-07-01 17:33 UTC]
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 "Open". Thank you.

I can not reproduce this, and their was no feedback
 [2003-09-13 17:27 UTC] n-a at mail dot com
I have the same bug in php 4.3.1
This bug is presented only with SOME servers. Approx. 5-10% of internet servers.
 [2004-01-14 04:45 UTC] ruben at textinfo dot nl
I'm experiencing the same problem with PHP 4.3.4 on Windows 2000 Advanced Server running IIS 5 and on a Solaris 9 machine running PHP 4.2.2.

I'm using:

 $this->socket = fsockopen($serverip, $serverport);

to open the connection and:

to close it. If I check the server it connects to with netstat after the fclose call the connection stays in CLOSE_WAIT state.
Is there any solution for this already?
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 02 13:01:27 2023 UTC