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

LOOPing Problem
Hello All!

The following code loops through the data and displays the data accordingly. My p

Simple Scraper... Weird Output
Okay, maybe I just need a Blue Monster and some sleep, but....

I'm scraping a ringtone site

Retrieving innerHTML with cURL?
Hey all (sorry I know I'm a leecher, but I soon won't be. This is my first PHP project, but not my l

How would I convert this into code using an if statement?
ES equals exam score m equals $mean s equals $total. I already coded my mean and total so I'm not g

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc

Remove values in array2 from array1
I have two arrays.

Array 1 is where the array key holds various different numbers. For exampl

Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL s

Removing Title From database problem
Hi again ! i am having an issue with updating database. When i update any price of a title it remove

Procedure with variable number of columns
Hi, I have a procedure that looks like this:

PROCEDURE PROC(p_cursor OUT sys_refcurso

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