php.net |  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
Votes:6
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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: clothohk at gmail dot com
New email:
PHP Version: OS:

 

 [2009-02-06 05:04 UTC] clothohk at gmail dot com
Description:
------------
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:
---------------
eg. 
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] langemeijer@php.net
What do you think of the solution in this feature request: bug #63233
 [2012-12-09 10:26 UTC] langemeijer@php.net
-Status: Open +Status: No Feedback
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jun 19 18:01:23 2021 UTC