ssh2 using Windows

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

i'm using Windows to access an ssh server. everything works perfect
until i try executing files (ssh2_exec) and sending/receiving files
(ssh2_scp_send/ssh2_scp_recv)... in the function manual at it
has the following example to execute a command:

 ssh2_exec($connection, '/usr/local/bin/php -i');

i'm assuming this is for linux/unix machines, so on a Windows machine,
should it be possible to do the following?

 ssh2_exec($connection, 'c:/php/php.exe c:/a.php');

it doesn't seem to be working (the "a.php" file simply contains
"file_put_contents('c:/bbbbb.txt','111');" and therefore doesn't create
"bbbbb.txt"), however, the 'c:/php/php.exe c:/a.php' command works
perfectly using a ssh client such as PuTTY.

also, with the send/receive functions, it comes up with errors. for
example, "ssh2_scp_recv($connection, 'c:/a.php', 'c:/aa.php');" comes
up with the error "Unable to receive remote file". when creating a
directory i have noticed that i must be beginning in the directory:
"c:/documents and settings/administrator/desktop", because when using
"ssh2_sftp_mkdir($sftp, 'aaa');", it puts the directory "aaa" into that
location - ie, i have to use "ssh2_sftp_mkdir($sftp,
'../../../../aaa');" to create the "aaa" directory at c:/aaa


Site Timeline