returning data from an ssh2_exec()


Posted on 16th Feb 2014 07:03 pm by admin

here's what i got.


$conn = ssh2_connect($this->_host);
ssh2_auth_password($conn,$this->_user,$this->_pass)or die("Cannot Connect");
//build command line to include this jobnumber
$command = '/usr/local/bin/invoiced_date.sh ' . $jobnumber;
//issue the command line
$stream = ssh2_exec($conn,$command);
stream_set_blocking($stream,true);

$output = ssh2_fetch_stream($stream,SSH2_STREAM_STDERR);
echo 'what i got: ' . $output;


when this echo's i get.

Code: [Select]what i got: Resource id #7

how do i turn Resource id #7 into actual information?

Thanks in advance,

No comments posted yet

Your Answer:

Login to answer
342 Like 37 Dislike
Previous forums Next forums
Other forums

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

need help with php get
i have a option box that gets filled with dates, but how do i get once the option value has been cli

Get content from table into a list, without repeating.
Alright this is kinda an odd thing, so I need some help.

I have a table "quote" wit

xml
<?php

echo "<h1>XML Articles</h1>";

$home

SAP BCS. BPS
Hi all,

I am seeking reading note on the following in BW

BCS, BPS
ADVANCE

The IE or FF detector
Hello Friends,

Problem of today ( we seek for php help ) as following ,

we know all th

Storing user data help?
Hey Guys,

I'm not use if this question is to broad but I can always give you more informatio

A href problem under php
Hello...

I tried to explain the issue in an earlier post.. but was not clear enough....

[Need Help] php timing issues
I don't know what is going wrong. I need some help with being able to set an image at 9:00am Colorad

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash