|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57764 channels are not getting closed
Submitted: 2007-07-31 10:55 UTC Modified: 2013-02-18 00:35 UTC
From: Assigned:
Status: No Feedback Package: ssh2 (PECL)
PHP Version: 5.2.1 OS: Linux
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:
New email:
PHP Version: OS:


 [2007-07-31 10:55 UTC]
It seems, that the command ssh2_exec (and others) does open a new channel, every time it is called, but these channels are not getting closed. If I want to send more commands than open channels are allowed, i am getting the following error on the server side:

Jul 25 12:43:06 sles10vm sshd[19087]: error: no more sessions

These channels should be closed automatically (fclose($stream) ?) or there should be functions to close them (ssh2_close($stream) for example).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-10 07:11 UTC] noels01 at gmx dot net
same problem here. I stumbled upon this bug when switching from HP-UX to a Linux system. The relevant setting for the OpenSSH daemon seems to be
session.c:#define MAX_SESSIONS 10
Thus only 10 ssh2_exec's are possible and then it fails. This shouldn't be a problem if it would be possible to close open sessions or if they were closed automatically.
 [2008-04-30 06:25 UTC] volkirik-wants-nospam at yahoo dot com dot tr
we experience same here, this problem should be solved,

there should be a way to close channels
 [2008-05-09 12:54 UTC] volkirik at yahoo dot com dot tr
fclose is supported for ssh2_exec streams...

It'll close that stream, but the connection remains open...

To close SSH2 connection: you have to close all child streams with fclose($stream) then unset the connection context

Volkan K.
 [2012-06-14 22:07 UTC]
Is this still an issue? I think it might have been solved in an previous release.
 [2012-06-14 22:07 UTC]
-Status: Open +Status: Feedback
 [2013-02-18 00:35 UTC] pecl-dev 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 "Open". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Dec 07 11:05:53 2022 UTC