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

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

I need help on this PHP code
Hi everybody, I made some kind of mistake while editing the code below. As you see, at the 3 row my

admin with my register system?
Hey i wana make it so i can make a admin level on my register system , I'm kinda new to php to im no

Echo multiple lines of html code
Hi guys,

I would like to know if there is a way to echo multiple lines of html codes.

How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<

Need help to identify this error please
:confused:Can anyone help me tell what this error message means? Maybe tell me where to look to fix

problem with array - multilingual page
this is my test page :
Code: <?php
if(isset($_GET['lang'])) {
if($_GET['la

Php WordPress help
I am writing the following code for making a plugin

<?php
header("Content-Type

Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste

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