|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
12 + 33 = ?
Subscribe to this entry?

 [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 10:05:59 2022 UTC