as of 0.9 and above, if not allocating a pty, add FALSE to the call...
old way:
ssh2_exec($connection, $command);
new way:
ssh2_exec($connection, $command, FALSE);
ssh2_execDescriptionresource ssh2_exec ( resource session, string command [, string pty [, array env [, int width [, int height [, int width_height_type]]]]] )Execute a command at the remote end and allocate a channel for it. Returns a stream on success or FALSE on failure. See Also: ssh2_connect(), ssh2_shell(), and ssh2_tunnel()
add a note
User Contributed Notes
col at pobox dot com
16-Oct-2006 06:55
as of 0.9 and above, if not allocating a pty, add FALSE to the call...
tabber dot watts at gmail dot com
03-Dec-2005 07:21
This is the best way I found to automatically run multiple commands or commands that might take longer then expected. NOTE: this assumes that no where in the output is there the text '[end]' otherwise the function will end prematurely. Hope this helps people.
gakksimian at yahoo dot com
08-Sep-2005 01:15
Executing remote Windows commands...
yairl at savion dot huji dot ac dot il
09-Jun-2005 08:03
If you want to run many exec orders throught ssh2 in the same process using the same variable $stream for exemple and to read the output for each order, you must close the stream after each order else you will not be able to read the next order output. | |||