|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58538 ssh2_exec should return exit status
Submitted: 2009-02-06 05:04 UTC Modified: 2012-12-09 10:26 UTC
Avg. Score:5.0 ± 0.0
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:3 (50.0%)
From: clothohk at gmail dot com Assigned:
Status: No Feedback Package: ssh2 (PECL)
PHP Version: 5.1.6 OS: CentOS 5
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:
22 + 2 = ?
Subscribe to this entry?

 [2009-02-06 05:04 UTC] clothohk at gmail dot com
PECL package: ssh2 0.11.0

I suggest that there should be a function like ssh_exec(),
which can return exit status of the executed command.

Reproduce code:
list($status, $output) = ssh_exec_with_status("service httpd status");

Expected result:
$status will be 0 if httpd is running.
$output will be some output text.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-06 05:07 UTC] pierre dot php at gmail dot com
package > ssh2
 [2012-03-08 14:44 UTC] fi0 at gmx dot net
I wonder a lot why the support of a return value isn't implementend yet. This is exactly the functionality I would expect (similar to exec and system php functions used locally)!

Right now u have to use a second ssh2_exec with $? to get the return code of the command executed ...
 [2012-10-07 19:58 UTC]
What do you think of the solution in this feature request: bug #63233
 [2012-12-09 10:26 UTC]
-Status: Open +Status: No Feedback
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 17:03:35 2021 UTC