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

Multi image upload
I have a gallery to build and want to build a dynamic upload form to allow for $var number of fields

Curl timeout breaks script
So im having difficulties with skipping timeout error in curl
my script calls different functions

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

Gaining access to Drop Down Menu Variable
code is below, I am creating a drop down menu. I want to echo the value selected in the drop down me

how to remove in php string display
My code is $message="We're looking at developing our website."; $body= "My mess

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